Hello all,
I'm trying to demodulate an Ir input using FTM inputs. I managed to use ACMP I/Os to filter IR receiver hysteresis, nevertheless, when trying to configure FTM1 to filter carrier frequency I get stucked on configuring some FTM registers. When I try:
FTM1->SC = 0;
FTM1->CONF = 0xC0;
FTM1->FMS = 0;
FTM1->MODE = FTM_MODE_WPDIS_MASK;
FTM1->CONTROLS[0].CnSC = FTM_CnSC_ELSA_MASK;
FTM1->CONTROLS[0].CnV = 0x3FFF;
FTM1->FLTCTRL = FTM_FLTCTRL_FAULT0EN_MASK;
FTM1->FLTPOL = FTM_FLTPOL_FLT0POL_MASK;
accessing FMS, MODE, FLTCTRL of FLTPOL from FTM1 i get pushed to a WatchdogIRQ (probably an unhandled Default_IRQ).
Using same registers from FTM2 give me no such error! Although FTM0 and FTM1 doesn't allow access to those register. Am I missing any config?
Also, I'm trying to follow Features of the FlexTimer to create an IR demodulator, but any material on the subject would be great.
Thank you all.
Solved! Go to Solution.
Hello Otavio Borges,
Please take care, FTM0,1 is not the same as FTM2, FTM0,1 is the basic FTM component, more details, you can find it from the KE02 reference manual.pdf
the table 3-33. FTM modules features
So, you can't configure MODE register in FTM1, it is correct, because FTM0,1 don't have this function.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Otavio Borges,
Please take care, FTM0,1 is not the same as FTM2, FTM0,1 is the basic FTM component, more details, you can find it from the KE02 reference manual.pdf
the table 3-33. FTM modules features
So, you can't configure MODE register in FTM1, it is correct, because FTM0,1 don't have this function.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you Kerry.
But, besides that. Can I use the FTM to demodulate an IR signal? The input signal is an 500us burst of a 50% duty cycle on a 38kHz carrier. Here 1s are the mentioned burst followed by 1500us of silence and 0s same burst followed by 500us silence. If I can manage to filter the square wave burst into an constant 1 I can decode the data. I've tried using the dual edge capture mode of FTM but, as the signal is not an constant PWM signal the FTMx_CnV is not updated when duty cycle is 0.
Hi Otavio Borges,
About the KE IR usage, we have some post for your reference:
1. Implementing infrared functions on UART0 with FRDM-KE02Z platform.
2. IRDA bit banging on FRDM-KE02Z
Please refer to it at first.
If you still have question after refer to that post, just let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------