Hello NXP Team,
I am working with the MCIMX93-EVK and trying to run the TPM input capture example using TPM3_CH2, which is mapped to GPIO_IO12 on the board.
I followed the hardware guidelines:
Connected a test signal (button) between J1005-3 (GPIO_IO12) and J1005-7 (GND)
Verified 3.3V logic and falling edge transition is present when pressing the button
However, the code never enters the TPM3_IRQHandler, and the capture value is not being printed in the terminal.
Here is my modified code:
#include "fsl_debug_console.h"
#include "board.h"
#include "app.h"
#include "fsl_tpm.h"
#include "fsl_rgpio.h"
volatile bool tpmIsrFlag = false;
void TPM3_IRQHandler(void)
{
tpmIsrFlag = true;
TPM_ClearStatusFlags(TPM3, kTPM_Chnl2Flag);
SDK_ISR_EXIT_BARRIER;
}
int main(void)
{
tpm_config_t tpmInfo;
BOARD_InitHardware();
PRINTF("\r\nTPM input capture example\r\n");
PRINTF("\r\nOnce the input signal is received the input capture value is printed\r\n");
TPM_GetDefaultConfig(&tpmInfo);
TPM_Init(TPM3, &tpmInfo);
// Configure TPM3_CH2 input capture (falling edge)
TPM_SetupInputCapture(TPM3, kTPM_Chnl_2, kTPM_FallingEdge);
TPM_SetTimerPeriod(TPM3, 0xFFFFFFFFU);
TPM_EnableInterrupts(TPM3, kTPM_Chnl2InterruptEnable);
EnableIRQ(TPM3_IRQn);
TPM_StartTimer(TPM3, kTPM_SystemClock);
while (!tpmIsrFlag) { }
PRINTF("\r\nCapture value C(n)V=%x\r\n", TPM_GetChannelValue(TPM3, kTPM_Chnl_2));
while (1) { }
}
TPM Module: TPM3
Channel: CH2
Pin Used: GPIO_IO12 (confirmed to be J1005-3)
Edge: Falling edge
Board: MCIMX93-EVK
Clock: Default system clock settings
Is GPIO_IO12 correctly mapped to TPM3_CH2 in the EVK?
Do I need any additional IOMUXC or pinmux configuration to enable TPM3_CH2 capture?
Is IOMUXC_SetPinMux() or IOMUXC_SetPinConfig() required explicitly for GPIO_IO12?
Can you confirm if TPM3_CH2 is routed and enabled by default on MCIMX93-EVK?
Any insight or working examples using TPM3_CH2 would be greatly appreciated.
Thank you!