MCUXpresso SDK Documentation

tpm_dual_edge_capture

tpm_dual_edge_capture#

Overview#

The TPM project is a demonstration program of the SDK TPM driver’s dual-edge capture feature. This feature is available only on certain SoC’s. The example sets up a TPM channel-pair for dual-edge capture. Meanwhile, the capture mode is set up one-shot, using API TPM_SetupDualEdgeCapture(). Once the input signal is received and the second edge is detected, the interrupt flag will be cleared and the interrupt overflow will be disabled. The example gets the capture value of the input signal using API TPM_GetChannelValue(). This example will print the capture values and period of the input signal on the terminal window.

Supported Boards#

EVK9-MIMX8ULP
Hardware requirements
  • Micro USB cable

  • MIMX8ULP-EVK/EVK9 board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J11-3

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.

  2. Connect a micro USB cable between the host PC and the J17 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
IMX952LPD5EVK-19
Hardware requirements
  • Micro USB cable

  • IMX952-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM7: Connect input signal to TP86

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.

  2. Connect a micro USB cable between the host PC and the J31 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
EVK-MCIMX7ULP
Hardware requirements
  • Micro USB cable

  • MCIMX7ULP-EVK board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings
  • Connect input signal to J9-4. Please note both sides of R149 should be short-circuited.

Please note this application can’t support running with Linux BSP!

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW1 to power on the board.

  2. Connect a micro USB cable between the host PC and the J6 USB port on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see information from the terminal as below.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=0

Capture value C(n+1)V=26d4

Input signals pulse width=82 us
EVK-MIMX8ULP
Hardware requirements
  • Micro USB cable

  • MIMX8ULP-EVK/EVK9 board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J11-3

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW10 to power on the board.

  2. Connect a micro USB cable between the host PC and the J17 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
FRDM-K32L2A4S
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L2A4S board

  • Personal Computer

Board settings
  • Connect input signal to J2-6

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 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 example.

Running the demo

When the example runs successfully, you can see information from the terminal as below.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=0

Capture value C(n+1)V=26d4

Input signals pulse width=82 us
FRDM-K32L3A6
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings

M0 core: Connect input signal to PTB13(J1-8). M4 core: Connect input signal to PTB2(J2-2).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 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 example.

Running the demo

When the example runs successfully, you can see information from the terminal as below.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=0

Capture value C(n+1)V=26d4

Input signals pulse width=82 us
FRDM-MCXW71
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW71 Board

  • Personal Computer

Board settings

connect input signal to J1-8

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J10.

  2. Open a serial terminal with the following settings:

    • 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 following lines are printed to the serial terminal when the demo program is executed.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
MCX-W71-EVK
Hardware requirements
  • Type-C USB cable

  • MCX-W71-EVK Board

  • Personal Computer

Board settings

connect input signal to J1-15

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. Open a serial terminal with the following settings:

    • 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 following lines are printed to the serial terminal when the demo program is executed.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
IMX95LPD5EVK-19
Hardware requirements
  • Micro USB cable

  • IMX95LPD5-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM7: Connect input signal to R881

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.

  2. Connect a micro USB cable between the host PC and the J31 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
FRDM-IMX95
Hardware requirements
  • Micro USB cable

  • FRDM-IMX95 board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM7: Connect input signal to J19-32

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.

  2. Connect a micro USB cable between the host PC and the J31 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
FRDM-IMX952
Hardware requirements
  • Micro USB cable

  • IMX952-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM7: Connect input signal to GPIO_IO13(J18-33)

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.

  2. Connect a micro USB cable between the host PC and the J31 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
FRDM-IMX937
Hardware requirements
  • Micro USB cable

  • FRDM-IMX937 board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM7: Connect input signal to J19-32

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW4 to power on the board.

  2. Connect a micro USB cable between the host PC and the J31 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
KW45B41Z-EVK
Hardware requirements
  • Mini/micro USB cable

  • KW45B41Z-EVK Board

  • Personal Computer

Board settings

connect input signal to J1-8

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. Open a serial terminal with the following settings:

    • 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 following lines are printed to the serial terminal when the demo program is executed.

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
KW47-EVK
Hardware requirements
  • Type-C USB cable

  • KW47-EVK Board

  • Personal Computer

Board settings

connect input signal to J1-15

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. Open a serial terminal with the following settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
MCIMX93AUTO-EVK
Hardware requirements
  • USB Type-C cable

  • MCIMX93AUTO-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J17-16

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW2 to power on the board.

  2. Connect a USB Type-C cable between the host PC and the J26 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
MCIMX93-EVK
Hardware requirements
  • USB Type-C cable

  • MCIMX93-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J1005-3

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.

  2. Connect a USB Type-C cable between the host PC and the J1401 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
MCIMX93W-EVK
Hardware requirements
  • USB Type-C cable

  • MCIMX93W-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J1005-3

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.

  2. Connect a USB Type-C cable between the host PC and the J1401 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
MCIMX93-QSB
Hardware requirements
  • USB Type-C cable

  • MCIMX93-QSB board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • CM33: Connect input signal to J1406-3

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.

  2. Connect a USB Type-C cable between the host PC and the J1708 USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us 
MCX-W72-EVK
Hardware requirements
  • Type-C USB cable

  • MCX-W72-EVK Board

  • Personal Computer

Board settings

connect input signal to J1-15

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. Open a serial terminal with the following settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
KW47-LOC
Hardware requirements
  • Type-C USB cable

  • KW47-LOC Board

  • Personal Computer

Board settings

connect input signal to J1-1

Prepare the Demo
  1. Connect a USB cable between the host PC and the LOC board J3.

  2. Open a serial terminal with the following settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
MCXW72-LOC
Hardware requirements
  • Type-C USB cable

  • MCXW72-LOC Board

  • Personal Computer

Board settings

connect input signal to J1-1

Prepare the Demo
  1. Connect a USB cable between the host PC and the LOC board J3.

  2. Open a serial terminal with the following settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
FRDM-MCXW72
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW72 Board

  • Personal Computer

Board settings

Connect input signal to J1-8.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J10.

  2. Open a serial terminal with the following settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
FRDM-KW43
Hardware requirements
  • Type-C USB cable

  • FRDM-KW43 Board

  • Personal Computer

Board settings

Connect input to J19-4. This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
FRDM-MCXW70
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW70 Board

  • Personal Computer

Board settings

Connect input to J19-4. This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 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 demo in the terminal window:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed
The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=11d5a52

Capture value C(n+1)V=11d5a60

Input signals pulse width=2 us
IMX943-EVK
Hardware requirements
  • Micro USB cable

  • IMX943-EVK board

  • J-Link Debug Probe

  • 12V~20V power supply

  • Personal Computer

Board settings
  • Connect input signal to J47-6

  • note: square wave at fixed rate is recommended as the input signal for easily checking the result.

Prepare the Demo
  1. Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW1(SYS_PWR) to power on the board.

  2. Connect a micro USB cable between the host PC and the J15(FTDI_DEBUG) USB port on the cpu board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TPM dual-edge capture example

Once the input signal is received the input capture values are printed

The input signal's pulse width is calculated from the capture values & printed

Capture value C(n)V=8c40

Capture value C(n+1)V=e104

Input signals pulse width=904 us