Read FTMx_CnV in Output Compare Mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read FTMx_CnV in Output Compare Mode

1,147 Views
aberger
Contributor V

In output compare mode, does reading the FTMx_CnV register return the buffered value, or the loaded value? 

1. Under an FTM overflow interrupt, I am calculating an output compare value and loading it into the FTMx_CnV buffer for loading at the next loading point (which I have configured as CNTMIN).

2. During that same interrupt cycle (i.e. before reaching the loading point), it's possible that I've also experienced an output compare match to the previously loaded CnV value. I would like to read that loaded CnV value and not the recently buffered value. Is this possible, or will reading the FTMx_CnV value return the recently buffered value from step (1). 

Tags (2)
0 Kudos
Reply
3 Replies

1,056 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Andy, 

Can you let me know which MCU are you using?

Best Regards,

Alexis Andalon

0 Kudos
Reply

1,056 Views
aberger
Contributor V

I'm using a K64 (MK64FN1M0VMD12, specifically)

0 Kudos
Reply

1,056 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Andy,

I see that you are using the same channel in output compare mode and as overflow. These two modes can interfere between them. So it will be better if you use independent channels for each of the events.

Best Regards,

Alexis Andalon

0 Kudos
Reply