Now I use MK22FN1M0AVLH12 64pin chip, on page 997 of K22 Sub-Family Reference Manual, Rev. 5, March 15, it mentioned that FTM Quadrature Decoder, but I can't find the which pin of MK22FN1M0AVLH12 connect to Phase A, Phase B. If possible, could you please show me Phase A and Phase B pins number and demo SW?
Thanks in advance!
Thanks a lot for your reply, also thanks a lot for your Freemaster tool recommendation.
But I want to use "FTM2 Quadrature Decoder" to sample FTM2_QD_PHA and FTM2_QD_PHB signals, and read the FTM counter, it is for motor speed detection.
Any KSDK2.0 example for "Quadrature decoder mode" using FTM?
As the other engineers said that the K22 has three FTM modules FTM0/FTM1/FTM2, the FTM0 has 8 channles, and is used to generate PWM signhal to control motor, only the FTM1 and FTM has the decodering function. The FTM1 decoding pin are FTM1_QD_PHA/FTM1_QD_PHB, the FTM2 decodering pins are FTM2_QD_PHA/FTM2_QD_PHB, The RM has the pin assiognment as Kiss said.
I suggest you refer to an5142, which has the code for decodering.
Hope it can help you.
Thank you a lot for your reply, it is helpful. Yes, I saw the demo code in the page 18 of an5142, there is quadratureDecoder intial and period interrupt. Now I want to pop up the counter value when encoder PHA & PHB happen, so I want to use the processor express to realize the code. But I don't know how to setting?
Could you please give me some advice?
The below site, which have some setting about it, but it lost some picture or infromation.
Anyone have any input about, "want to pop up the counter value when encoder PHA & PHB dual edge"? It means that at the dual edge of PHA & PHB trigger interrupt, and enter ISR?
where do you want to pop up the FTM counter? I think you can use Freemaster tools to display the FTM counter, in the case, you can read the FTM counter to a variable in the main loop so that Freemaster tools can display the variable. As an alternative, you can use PIT to generate an interrupt, in the ISR of PIT, read FTM counter to a variable so that the Freemaster tools can display it.
If you use UART module to transfer the FTM counter, you can read the FTM counter in the ISR of UART.
Hope it can help you.
You can use either the Ref Manual or the Datasheet to check it. DS, you can try http://www.nxp.com/files/32bit/doc/ref_manual/K22P64M120SF5V2RM.pdf?fasp=1&WT_TYPE=Reference%20Manua...
In RM, in Chapter 10.3, you can see a table for pin vs functions. For Quadrature, it depends on which FTM you intend to use. For example, for FTM1, pins 28 and 29 can be set for Quadrature function using the ALT7 (pin function alternative 7) or pins 35 and 36 using ALT6.
For selecting Pins you can use in the Kinetis Expert SW Website the Pins Tool - https://kex.nxp.com/en/pins. There you can check all the possibilities for Quadrature.