AnsweredAssumed Answered

SWOCTRL usage

Question asked by Francesco Vico on May 13, 2019
Latest reply on May 13, 2019 by Razvan-nicolae Tilimpea

Hello , I have a problem using output compare outputs.

I would like (after a generic event) to set an output compare channel output and after that run a delayed action on this output compare channel.

The wrong code is:

...

...

FTM0->SWOCTRL = 0x1010;                                      /*(1)     Set "1" FTM0_CH4 using Software Output Control*/
FTM0->CONTROLS[4].CnSC = 0x18;                           /* (2)   FTM0_CH4 clear on match*/

FTM0->CONTROLS[4].CnV= (FTM0->CNT + 100);     /* (3)  Match delayed of 100 clock cycle*/
FTM0->SWOCTRL = 0x0;                                              /* (4)  Remove Software Output Control*/

...

...

 

After row (1) the FTM0_CH4 goes correctly high.

In row (2) and (3) I run a delayed clear of FTM0_CH4 after 100 clock cycles.

In row (4) I remove the software output control to permit delayed clear started in row (2) and (3), but after row (4) the  FTM0_CH4 channel goes low immediately whithout delay.

Thanks a lot .

 

Outcomes