iMXRT1024 Quad Timer Count Mode external signal

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMXRT1024 Quad Timer Count Mode external signal

Jump to solution
837 Views
JasonGT93
Contributor II

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.

0 Kudos
Reply
1 Solution
825 Views
jay_heng
NXP Employee
NXP Employee

It should be kQTMR_ClockCounter3InputPin in your case, as you enable Channel_3

qtmrConfig.primarySource = kQTMR_ClockCounter3InputPin;

 

View solution in original post

0 Kudos
Reply
2 Replies
813 Views
JasonGT93
Contributor II

Hello jay_heng,

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.

0 Kudos
Reply
826 Views
jay_heng
NXP Employee
NXP Employee

It should be kQTMR_ClockCounter3InputPin in your case, as you enable Channel_3

qtmrConfig.primarySource = kQTMR_ClockCounter3InputPin;

 

0 Kudos
Reply