Use FlexTimer1 as Quadrature Decoder

Hi, I wish to use the quadrature encoder feature using flextimer1 on colibri imx7 SOM. DO i need to configure the clocks for the same? Can you let me know the steps I need to follow for setting it up ?

Do I need to enable and modify the clock registers before I move towards flextimer register? Also what are the registers I need to work with to get the timer running for quadrature encoder?

Dear @tank

According to the iMX7 reference manual, the quadrature encoder is self-clocked (beside some synchronization which uses the always-on system clock). Therefore it should not be necessary to enable any clock.

Make sure that you configure the used CPU pins to the appropriate alternate function. You can verify this easily using our GpioConfig tool.

There’s also some general information in the iMX7 Reference manual about how to program the FlexTimer. Search for the keyword “quadrature decoder”.

Regards, Andy

Hi Andy,

Thank you for helping me out. I asked this I was having a look at the WEIM sample code. Also I see that you have CCM_TARGET_ROOT110 to select source and CCM_CCGR128 register associated with FLEXTIMER1.

Dear @tank

I made my statement based on the diagram of the FlexTimer architecture (Reference manual, section, see below). Here the flex timer does not need any additional clock.


Regards, Andy