iMXRT1024 Quad Timer Count Mode external signal

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

iMXRT1024 Quad Timer Count Mode external signal

跳至解决方案
689 次查看
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 项奖励
回复
1 解答
677 次查看
jay_heng
NXP Employee
NXP Employee

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

qtmrConfig.primarySource = kQTMR_ClockCounter3InputPin;

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
665 次查看
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 项奖励
回复
678 次查看
jay_heng
NXP Employee
NXP Employee

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

qtmrConfig.primarySource = kQTMR_ClockCounter3InputPin;

 

0 项奖励
回复