<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TPM :  Input_capture driver in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1950608#M4929</link>
    <description>&lt;P&gt;Hi NXP&lt;/P&gt;&lt;P&gt;I am working on TPM input_capture dirver As per M33 SDK the GPIO driver is available in the path /M33 Sdk /imx93-SDK/boards/mcimx93 evk/driver_examples/tpm/input_capture&lt;/P&gt;&lt;P&gt;how to give frequency through function generator as input witch GPIO pin select for&amp;nbsp; printing actual value&amp;nbsp; example TPM2 is base address and kTPM_ch0 channel TPM2_CH0, GPIO1_Io00&lt;/P&gt;&lt;P&gt;i am not sure that my question is write or wrong&lt;/P&gt;&lt;P&gt;please provide some information about input_capture driver&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2024 04:54:25 GMT</pubDate>
    <dc:creator>Rakesh_Kumar-Thakur</dc:creator>
    <dc:date>2024-09-10T04:54:25Z</dc:date>
    <item>
      <title>TPM :  Input_capture driver</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1950608#M4929</link>
      <description>&lt;P&gt;Hi NXP&lt;/P&gt;&lt;P&gt;I am working on TPM input_capture dirver As per M33 SDK the GPIO driver is available in the path /M33 Sdk /imx93-SDK/boards/mcimx93 evk/driver_examples/tpm/input_capture&lt;/P&gt;&lt;P&gt;how to give frequency through function generator as input witch GPIO pin select for&amp;nbsp; printing actual value&amp;nbsp; example TPM2 is base address and kTPM_ch0 channel TPM2_CH0, GPIO1_Io00&lt;/P&gt;&lt;P&gt;i am not sure that my question is write or wrong&lt;/P&gt;&lt;P&gt;please provide some information about input_capture driver&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 04:54:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1950608#M4929</guid>
      <dc:creator>Rakesh_Kumar-Thakur</dc:creator>
      <dc:date>2024-09-10T04:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: TPM :  Input_capture driver</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1955621#M4934</link>
      <description>&lt;P&gt;Hi NXP please reply related to input Capture driver&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 13:05:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1955621#M4934</guid>
      <dc:creator>Rakesh_Kumar-Thakur</dc:creator>
      <dc:date>2024-09-17T13:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: TPM :  Input_capture driver</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1957231#M4938</link>
      <description>&lt;P&gt;Hi NPX&lt;/P&gt;&lt;P&gt;I am working on input capture driver provided by MCUXpresso SDK version 2.16. But I ran this driver on target machine with 100Hz frequency, so input capture value is coming different values ​​at the same given frequency. Clock source frequency is 24MHz which is given by TMR, prescaler value is 1. I have also configured other TPM counters and channels and tested them but the result is same. How to solve it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 06:06:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1957231#M4938</guid>
      <dc:creator>Rakesh_Kumar-Thakur</dc:creator>
      <dc:date>2024-09-19T06:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: TPM :  Input_capture driver</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1963928#M4955</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;
&lt;P&gt;How did you modify the SDK demo code? Have you test the original demo?&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 06:29:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/1963928#M4955</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2024-09-29T06:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: TPM :  Input_capture driver</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/2128828#M5224</link>
      <description>/*&lt;BR /&gt;* Copyright 2022 NXP&lt;BR /&gt;*&lt;BR /&gt;* SPDX-License-Identifier: BSD-3-Clause&lt;BR /&gt;*/&lt;BR /&gt;#include "fsl_sar_adc.h"&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "app.h"&lt;BR /&gt;#include "fsl_rgpio.h"&lt;BR /&gt;#include "fsl_tpm.h"&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt;* Variables&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;volatile bool captureDone = false;&lt;BR /&gt;volatile bool gotRisingEdge = false;&lt;BR /&gt;volatile uint32_t risingTime = 0;&lt;BR /&gt;volatile uint32_t fallingTime = 0;&lt;BR /&gt;uint32_t capturedValue = 0;&lt;BR /&gt;&lt;BR /&gt;/* clang-format on */&lt;BR /&gt;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt;* Code&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;void SetUp(void)&lt;BR /&gt;{&lt;BR /&gt;rgpio_pin_config_t out_config ={&lt;BR /&gt;kRGPIO_DigitalOutput,&lt;BR /&gt;0,&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;// Trigger pin will find range&lt;BR /&gt;RGPIO_PinInit(BOARD_RGPIO,TRIG_PIN,&amp;amp;out_config);&lt;BR /&gt;RGPIO_PinWrite(BOARD_RGPIO,TRIG_PIN,0);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void SendTrigPulse(void)&lt;BR /&gt;{&lt;BR /&gt;RGPIO_PinWrite(BOARD_RGPIO, TRIG_PIN, 0);&lt;BR /&gt;SDK_DelayAtLeastUs(2, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);&lt;BR /&gt;RGPIO_PinWrite(BOARD_RGPIO, TRIG_PIN, 1);&lt;BR /&gt;SDK_DelayAtLeastUs(10, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY); // 10us pulse&lt;BR /&gt;RGPIO_PinWrite(BOARD_RGPIO, TRIG_PIN, 0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void TPM_INPUT_CAPTURE_HANDLER(void)&lt;BR /&gt;{&lt;BR /&gt;capturedValue = TPM_GetChannelValue(DEMO_TPM_BASEADDR, BOARD_TPM_INPUT_CAPTURE_CHANNEL);&lt;BR /&gt;&lt;BR /&gt;if (!gotRisingEdge)&lt;BR /&gt;{&lt;BR /&gt;risingTime = capturedValue;&lt;BR /&gt;gotRisingEdge = true;&lt;BR /&gt;&lt;BR /&gt;/* Switch to falling edge detection */&lt;BR /&gt;TPM_SetupInputCapture(DEMO_TPM_BASEADDR, BOARD_TPM_INPUT_CAPTURE_CHANNEL, kTPM_FallingEdge);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;fallingTime = capturedValue;&lt;BR /&gt;captureDone = true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;TPM_ClearStatusFlags(DEMO_TPM_BASEADDR, TPM_CHANNEL_FLAG);&lt;BR /&gt;SDK_ISR_EXIT_BARRIER;&lt;BR /&gt;}&lt;BR /&gt;/*!&lt;BR /&gt;* @brief Main function&lt;BR /&gt;*/&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;tpm_config_t tpmConfig;&lt;BR /&gt;uint32_t pulseTicks = 0, pulseUs = 0;&lt;BR /&gt;float distanceCm = 0.0f;&lt;BR /&gt;&lt;BR /&gt;BOARD_InitHardware();&lt;BR /&gt;SetUp();&lt;BR /&gt;&lt;BR /&gt;PRINTF("\r\nTPM Ultrasonic Distance Measurement Example\r\n");&lt;BR /&gt;&lt;BR /&gt;TPM_GetDefaultConfig(&amp;amp;tpmConfig);&lt;BR /&gt;TPM_Init(DEMO_TPM_BASEADDR, &amp;amp;tpmConfig);&lt;BR /&gt;&lt;BR /&gt;/* Start with rising edge capture */&lt;BR /&gt;TPM_SetupInputCapture(DEMO_TPM_BASEADDR, BOARD_TPM_INPUT_CAPTURE_CHANNEL, kTPM_RisingEdge);&lt;BR /&gt;TPM_SetTimerPeriod(DEMO_TPM_BASEADDR, 0xFFFFFFFFU);&lt;BR /&gt;TPM_EnableInterrupts(DEMO_TPM_BASEADDR, TPM_CHANNEL_INTERRUPT_ENABLE);&lt;BR /&gt;EnableIRQ(TPM_INTERRUPT_NUMBER);&lt;BR /&gt;TPM_StartTimer(DEMO_TPM_BASEADDR, kTPM_SystemClock);&lt;BR /&gt;&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;gotRisingEdge = false;&lt;BR /&gt;captureDone = false;&lt;BR /&gt;&lt;BR /&gt;PRINTF("Sending Trigger Pulse...\r\n");&lt;BR /&gt;SendTrigPulse(); /* Send trigger pulse exactly 10 us */&lt;BR /&gt;&lt;BR /&gt;/* Wait until both edges captured */&lt;BR /&gt;while (!captureDone) {}&lt;BR /&gt;&lt;BR /&gt;/* Calculate pulse width */&lt;BR /&gt;if (fallingTime &amp;gt;= risingTime)&lt;BR /&gt;pulseTicks = fallingTime - risingTime;&lt;BR /&gt;else&lt;BR /&gt;pulseTicks = (0xFFFF - risingTime) + fallingTime;&lt;BR /&gt;&lt;BR /&gt;/* Convert ticks to microseconds */&lt;BR /&gt;pulseUs = (pulseTicks * 1000000U) / TPM_SOURCE_CLOCK;&lt;BR /&gt;PRINTF("Time clock : %u\r\n",TPM_SOURCE_CLOCK);&lt;BR /&gt;&lt;BR /&gt;/* Convert to distance in cm */&lt;BR /&gt;distanceCm = pulseUs / 58.0f;&lt;BR /&gt;&lt;BR /&gt;PRINTF("[DEBUG]Captured value when Interrupt triggers : %u\r\n",capturedValue);&lt;BR /&gt;PRINTF("[DEBUG]Rising Edge Tick : %u\r\n", risingTime);&lt;BR /&gt;PRINTF("[DEBUG]Falling Edge Tick: %u\r\n", fallingTime);&lt;BR /&gt;PRINTF("Pulse Width : %u us\r\n",pulseUs);&lt;BR /&gt;PRINTF("Measured Distance : %d cm\r\n", (int)distanceCm);&lt;BR /&gt;PRINTF("\r\n");&lt;BR /&gt;&lt;BR /&gt;/* Reset to rising edge detection for new measurement */&lt;BR /&gt;TPM_SetupInputCapture(DEMO_TPM_BASEADDR, BOARD_TPM_INPUT_CAPTURE_CHANNEL, kTPM_RisingEdge);&lt;BR /&gt;&lt;BR /&gt;SDK_DelayAtLeastUs(1000000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;here i am using input capture example with our application ?&lt;BR /&gt;is their need to change any code here , this is not working ?&lt;BR /&gt;Here i interface HC-SR04 US sensor with i.mx93 board ?&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Jul 2025 07:43:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/TPM-Input-capture-driver/m-p/2128828#M5224</guid>
      <dc:creator>Manjunathb</dc:creator>
      <dc:date>2025-07-05T07:43:11Z</dc:date>
    </item>
  </channel>
</rss>

