Hello,
I want to count the rising edge of an external signal, but the external signal is not counted. I just follow the example from the reference manual and this post:
https://community.nxp.com/t5/i-MX-RT/QTMR-of-RT1064-counting-external-signal/m-p/1396101
I am using two evaluation board MIMXRT1024-EVK: the first board with a PWM configured to 1KHz (I checked the signal with the oscilloscope and the signal is fine) and the second board with the following code:
CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_QTIMER2_TIMER3, 0U); // J17-08
IOMUXC_GPR->GPR6 = ((IOMUXC_GPR->GPR6 & (~(IOMUXC_GPR_GPR6_QTIMER2_TRM3_INPUT_SEL_MASK))) | IOMUXC_GPR_GPR6_QTIMER2_TRM3_INPUT_SEL(0x00U));
qtmr_config_t qtmrConfig;
QTMR_GetDefaultConfig(&qtmrConfig);
qtmrConfig.primarySource = kQTMR_ClockCounter2InputPin;
QTMR_Init(TMR2, kQTMR_Channel_3, &qtmrConfig);
QTMR_StartTimer(TMR2, kQTMR_Channel_3, kQTMR_PriSrcRiseEdge);
static volatile uint16_t value;
while (true)
{
value = QTMR_GetCurrentTimerCount(TMR2, kQTMR_Channel_3);
}
The pwm signal is connected with the second board in the pin "GPIO_AD_B0_07" located in the connector J17 pin 10.
What is wrong? The information from the reference manual is really limited and I think that I missed something but I can not find out it.
已解决! 转到解答。