K82 FTM2 Quad decoder is inaccurate

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

K82 FTM2 Quad decoder is inaccurate

跳至解决方案
830 次查看
JustSomeGuy
Contributor II

I'm working with a K82 MCU and a magnetic encoder attached to a motor.  The encoder has 512 counts per rotation; with my targeted motor speed, the encoder output should be around 10KHz.  I've configured FTM2 as a quad decoder.  The clock is 60MHz and has a prescaler of 16.  I am not using semi-hosting for debugging.

The quad decoder is not working properly - it might be losing counts, but that's hard to say because the bigger issue is that the direction is unreliable.  When hand turning the motor, if I pause for a moment, then resume turning, there is a high probability that the direction will flip.  I've been at this for a while; changing clock frequencies, adding filters, etc. to no avail.  Scope captures of the encoder show a very clean signal.  What could be causing this?

标记 (3)
0 项奖励
回复
1 解答
794 次查看
JustSomeGuy
Contributor II

It turns out that the problem was an assembly defect - one of the MCU pins was not soldered down to its pad.  Firmware debugging is always an adventure.

在原帖中查看解决方案

3 回复数
798 次查看
JustSomeGuy
Contributor II

Thanks for the reply.  I'll have to dig up a freedom board and investigate.  I'm currently working with custom hardware that has the encoder routed to PTB18 and PTB19, so FTM2 is all I have at my immediate disposal.

0 项奖励
回复
795 次查看
JustSomeGuy
Contributor II

It turns out that the problem was an assembly defect - one of the MCU pins was not soldered down to its pad.  Firmware debugging is always an adventure.

803 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

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

The frdmk82f_ftm_quad_decoder_peripheral SDK example use the FTM1, Does the same thing happen to you with the latter?

Have a nice day!

0 项奖励
回复