Configure encoder controller to generate interrupts on phase_a and phase_b on i.MX RT1064 mcu

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

Configure encoder controller to generate interrupts on phase_a and phase_b on i.MX RT1064 mcu

1,881 次查看
thomas82
Contributor I

Hi,

I am working with a i.MX RT1064 mcu connected to a encoder.

I have configured the ENC controller of the mcu with default configuration using the config tool and it works succesfully, I detect the movement of the motor connected because I saw the counting of the pulse in debug.

Now, I would want to configure the ENC controller to generate interrupts on the edges of the phase_A and phase_B signals.

My encoder has only these two pins, is possible to do this without the pin trigger, home, index, posmatch ?

Thanks in advance,
Tommaso

0 项奖励
回复
2 回复数

1,852 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

The edges of the PHASEA and PHASEB signals cannot be programmed to interrupt the processor. The only available interrupts for that module are found in Table 56-2. Interrupt Summary of the reference manual IMXRT1064RM.

nxf86756_0-1674083974256.pngnxf86756_0-1674083974256.png

Hope it helps you. Please let me know if you have more questions about it.

Have a nice day!

0 项奖励
回复

1,839 次查看
thomas82
Contributor I

Hi,

thanks for your support.

I have used the position compare interrupt and I resolved.

The problem now is that after the reachment of the position, even if in the ENC1_IRQHANDLER I call the ENC_ClearStatusFlags function, arrive continuosly interrupts (with motor and encoder stopped).

I also have tried to set to 1 the CMPIRQ bit in the CTRL register with the instruction:

ENC1.EncoderId->CTRL = ENC1.EncoderId->CTRL | 0x2;

as reported in the reference manual but I don't resolve it.

Kindly could you help me ?

Thanks

0 项奖励
回复