FTM in Quadrature Decoder mode does not work on iMX7.

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

FTM in Quadrature Decoder mode does not work on iMX7.

3,292 Views
bipin7301
Contributor II

Hi,

I am using iMX7D processor for my application( Using Toradex Aster eval board iMX7D 512MB ). I'm trying to use its Flextimer ( FTM ) module in Quadrature decoder mode. Application being and optical encoder is connected to Phase A and Phase B inputs of FTM1 module and FTM counter will run(increment/decrements) based on these inputs.

I have made all the possible combinations to initialise the FTM registers and run the module but it didn't work for me.

When I was going through the reference manual  Document Number: IMX7DRM Rev. 1, 01/2018 , i found that there are mistakes in FTM registers in manual too. that i have understood and corrected somehow.

my question is that, Does this FTM module in Quadrature decoder mode really works on iMX7 processor ?

and If anyone has got it worked, please tell me.

source code attached.

Regards

Bipin Kumar

9 Replies

2,673 Views
bipin7301
Contributor II

Finally we are able to run the FTM in Quadrature decoder mode and that too using Win CE OS on iMX7.

Here we want to highlight few points :

  • There are mistakes in NXP reference manual. FTM register description, few registers bits alignment is incorrect. One has to refer Kinetis series MCU reference manual and see the correct register  alignment and description of FTM module.
  • FTM register memory map, few memory locations are skipped in map and that are not properly highlighted by NXP. These locations should be written UNUSED by NXP so that one can not make mistakes out of it. Again one has to refer Kinetis series MCU reference manual and see the skipped memory locations. One such example is FTM_FLTCTRL register at register offset location 0x7C.
  • FTM initialization procedure is very ambiguous in reference manual. Why could NXP not make a clear and understandable document for this ?
  • NXP does not respond to queries like this and ask for Professional services for such a basic thing. We have made repeated attempts to reach out to NXP/NXP support/Community but didn't get any solution. Don't you(NXP) think you should focus on your better documentation rather then shirking their responsibility to address customer needs and directing them towards paid professional services ?

Regards

Bipin Kumar

2,673 Views
shreyash_inters
Contributor II

Hello, bipinkumar

Can you please suggest where this Kinetis series MCU reference manual get it .

I'm looking for rotary encoder and that Uses Win CE OS on iMX7 environment.

0 Kudos
Reply

2,673 Views
Yuri
NXP Employee
NXP Employee

Hello,

   NXP Linux BSP FTM driver may be used as an example, at least for bit numbering.

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/pwm/pwm-fsl-ftm.c?h=git.kernel.org...

 

Regards,

Yuri.

0 Kudos
Reply

2,673 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bipin

some i.MX8QM ftm examples can be found on below link (sorry for i.MX7D such

examples are not available):

MCUXpresso SDK for i.MX Cortex-M --> SDK for i.MX 8QuadMax Beta

Alpha / Beta BSPs for Microprocessors|NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,673 Views
bipin7301
Contributor II

Hi Igorpadykov

Thanks for your response.

We are trying to run FTM module through Cortex A7 core. Is it possible to run FTM though Cortex A7 core ?

You were talking about Cortex-M in your response, does this feature works only with Cortex-M core ?

Operating system : Win CE 7.0

Hardware: Toradex Colibri Aster eval board iMX7D 512MB

Regards

Bipin Kumar

0 Kudos
Reply

2,673 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bipin

yes it is possible to run FTM with Cortex A7 core too.

Best regards
igor

0 Kudos
Reply

2,673 Views
bipin7301
Contributor II

Thanks IGOR for your response.

According to the iMX7 reference manual, the quadrature encoder is self-clocked . Therefore it should not be necessary to enable any clock. Is this statement is correct ?

Thanks in advance

Bipin Kumar

0 Kudos
Reply

2,673 Views
igorpadykov
NXP Employee
NXP Employee

ftm has clock gating register CCGR128,129, please check Table 5-12.

System Clocks and Gating  i.MX7D Reference Manual

http://cache.nxp.com/files/32bit/doc/ref_manual/IMX7DRM.pdf

~igor

0 Kudos
Reply

2,673 Views
bipin7301
Contributor II

Thanks IGOR for your response.

 

You have mentioned i.MX28 Reference Manual however we are talking about i.MX7.

Are you sure, we should refer i.MX28 Reference Manual ?

 

Thanks in advance

Bipin Kumar

0 Kudos
Reply