AnsweredAssumed Answered

How to periodically trigger the FTM using the PDB?

Question asked by Arthur Admiraal on Nov 13, 2016
Latest reply on Dec 4, 2016 by Arthur Admiraal

Hello everybody!


I am trying to periodically trigger the FTM using the PDB. The problem is that the FTM is only triggered once, not periodically, as suggested by this oscilloscope screenshot:Oscilloscope screenshot of the FTM output.

I have configured the FTM interrupt to stop the FTM after a pulse and then re-initialise it, so that it will produce another pulse when triggered by a sync signal. The first pulse in the image is caused by the initialisation of the FTM, and the second pulse is caused by the PDB triggering the FTM.


Afterwards, the PDB just simply doesn't seem to trigger the FTM anymore.


The PDB is setup using the following KSDK code:

pdb_config_t pdbConfigStruct;


pdbConfigStruct.triggerInputSource = kPDB_TriggerInput4;

PDB_Init(PDB0, &pdbConfigStruct);

PDB_SetModulusValue(PDB0, 1000U);

PDB_SetCounterDelayValue(PDB0, 0U);

PDB0->CH[1].C1 = PDB_C1_BB(0b00) | PDB_C1_TOS(0b00) | PDB_C1_EN(0b01); PDB_DoLoadValues(PDB0);


My current guess is that the pre-trigger lock as described in page 884 of the reference manual isn't being cleared, since I am not using the ADC, thus preventing further triggers. However, I have tried to initialise the ADC and to clear the sequence errors as described in page 5 of appnote AN4822, but all to no avail. In fact, clearing the sequence errors seemed to irrecoverably stop the PDB.


A more knowledgeable opinion is greatly appreciated.