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:
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:
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));
qtmrConfig.primarySource = kQTMR_ClockCounter2InputPin;
QTMR_Init(TMR2, kQTMR_Channel_3, &qtmrConfig);
QTMR_StartTimer(TMR2, kQTMR_Channel_3, kQTMR_PriSrcRiseEdge);
static volatile uint16_t value;
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.
Solved! Go to Solution.
Thanks! It was my mistake. Where can I find more information and examples codes about the QTMR? I need to migrate some projects to this microcontroller.