K82 FTM2 Quad decoder is inaccurate

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

K82 FTM2 Quad decoder is inaccurate

Jump to solution
829 Views
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?

Tags (3)
0 Kudos
Reply
1 Solution
793 Views
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.

View solution in original post

3 Replies
797 Views
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 Kudos
Reply
794 Views
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.

802 Views
_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 Kudos
Reply