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.CnSC = FTM_CnSC_ELSA_MASK;
FTM1->CONTROLS.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.