I.MXRT1062 measuring pulse duration using ACMP and EflexPWM

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

I.MXRT1062 measuring pulse duration using ACMP and EflexPWM

跳至解决方案
1,299 次查看
bzaz
NXP Employee
NXP Employee

Hi,

I am trying to use the ACMP to detect when my signal is above a given threshold and use an EflexPWM to measure the duration. Is there a way to do that ?

 

Regards,

 

bzaz

0 项奖励
1 解答
1,251 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Yes, I agree with you that you can use any of PWM_A/B/X signal as capture signal input pin. If you connect the ACMP1_OUT to FLEXPWM1_PWM0_EXTA via crossbar, with correct  PWM Source Select Register configuration, the ACMP1_OUT signal can output to PWM pin (PWM_A/B/X pads), but you can not guarantee that the PWM_A/B/X pad signals can be routed to the capture input pin of eFlexPWM module, I think it is 50% percent possibility that ACMP1_OUT signal  can be routed to capture input pin of eFlexPWM via crossbar. So you'd better have a test for the solution with EVK board.

 

If you output ACMP1_OUT signal to a predefined pad or to a crossbar pad, you connect the ACMP1_OUT signal pad to any of PWM_A/B/X pad signal via a cable, it is 100% percent okay.

Hope it can help you

BR

XiangJun Rong

 

在原帖中查看解决方案

0 项奖励
6 回复数
1,277 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Stephane,

I do not know your application, if the ACMP output is related to eFLEXPWM signals, it is okay to use capture function of the  eFLEXPWM module. If the ACMP output is not related to eFLEXPWM signals, I suggest you use the capture function of normal timer for example, you can use the capture function of GPT (General Purpose Timer) or the capture function of QuadTimer(TMR). For detailed inf, pls refer to
Chapter 52 General Purpose Timer (GPT) or Chapter 54 Quad Timer (TMR), because you can set up the Timer cycle time as large as possible.

If the ACMP output is related to eFLEXPWM signals, it is okay to use capture function of the  eFLEXPWM module, you can connect the captured signal to the PWMx_nA, so that you can get the duty cycle or cycle time. Pls refer to the community ticket for the capture function of eFlexPWM module.

https://community.nxp.com/t5/Digital-Signal-Controllers/The-Capture-feature-of-eFlexPWM-module/ta-p/...

 

Hope it can help you

BR

XiangJun Rong

 

I

 

0 项奖励
1,269 次查看
bzaz
NXP Employee
NXP Employee

Hi XiangJun,

An overview of my application is show in the diagram below.

Using EflexPWM to trigger the ADCs is straightforward. My issue is to use the ACMP output as a  trigger for the capture mode. In other word how to connect ACMP out to PWMX ? using xbar ?

Regards,

Stephane.

 

 

 

 

 

 

bzaz_0-1643014771261.png

 

0 项奖励
1,267 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I see your application, it is okay to use capture function of the eFlexPWM module to get the high logic time of ACMP output signal.

For connection, I have checked the xbar module, you can not use the xbar, because the PWMx_nX is not xbar output pin. Therefore, you have to connect the ACMP output pin to the PWMx_nX pin with external cable.

For example,

The pad GPIO_AD_B1_12 is ACMP1_OUT signal output pad.

The pad GPIO_AD_B0_02 is FLEXPWM1_PWM0_X input signal

You can connect the GPIO_AD_B1_12 and GPIO_AD_B0_02 pads together via cable.

xiangjun_rong_0-1643019090457.png

 

Hope it can help you

BR

XiangJun Rong

 

 

 

0 项奖励
1,260 次查看
bzaz
NXP Employee
NXP Employee

Hi,

I have seen that we can use any of the pwm IO as capture input (A, B or X), instead of using X I can use the A input for exemple and then using xbar to connec ACMP to PWM. For exemple xbar1_in26 to xbar1_out 26 to connect ACMP1 to PWM0_A. Am I correct ?

Regards,

Stephane.

 
0 项奖励
1,252 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Yes, I agree with you that you can use any of PWM_A/B/X signal as capture signal input pin. If you connect the ACMP1_OUT to FLEXPWM1_PWM0_EXTA via crossbar, with correct  PWM Source Select Register configuration, the ACMP1_OUT signal can output to PWM pin (PWM_A/B/X pads), but you can not guarantee that the PWM_A/B/X pad signals can be routed to the capture input pin of eFlexPWM module, I think it is 50% percent possibility that ACMP1_OUT signal  can be routed to capture input pin of eFlexPWM via crossbar. So you'd better have a test for the solution with EVK board.

 

If you output ACMP1_OUT signal to a predefined pad or to a crossbar pad, you connect the ACMP1_OUT signal pad to any of PWM_A/B/X pad signal via a cable, it is 100% percent okay.

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
1,235 次查看
bzaz
NXP Employee
NXP Employee

Hi,

 

Yes it helped a lot.

 

thanks for your support.

 

Regards,

 

Stephane.

0 项奖励