ADC trigger via FTM channels Rising edge or Falling edge

cancel
Showing results for 
Search instead for 
Did you mean: 

ADC trigger via FTM channels Rising edge or Falling edge

238 Views
529533342
Contributor I

Hi, Now I have a problem that I can't solve.I want to use the FTM channel pin to trigger the ADC acquisition, such as FTM0-> CH0,FTM1-> CH0 or FTM0-> CH0,If the channels  have a Rising edge or Falling edge,it can trigger ADC,if channels have no edge,it do not trigger ADC;but now if I add FTM1->EXTTRIG |=FTM_EXTTRIG_INITTRIGEN_MASK;It will trigger automatically and do not stop;I want to know if the FTM channel can trigger ADC like that?  Thank you!

Here's FTM1 initialization.

SIM->SCGC6 |= SIM_SCGC6_FTM1_MASK;
FTM1->MOD = period -1;
FTM1->CNTIN =0;
FTM1->CNT =0;
FTM1->SC= FTM_SC_CLKS(1)|FTM_SC_PS(7);

//FTM1->EXTTRIG |=FTM_EXTTRIG_CH1TRIG_MASK;

FTM1->EXTTRIG |=FTM_EXTTRIG_INITTRIGEN_MASK;

Labels (1)
0 Kudos
1 Reply

144 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi yu wu,

    This problem is the same question as the post in the eefocus, which I already reply you.

   You told me that you are using K60 chip.

   From the K60 reference manual:

pastedImage_1.png

So, if you enable the INITTRIGEN, the trigger will happen when the FTM coutner equal to CNTIN register.

If you want to use the edge, I think you can use the cannel trigger.

But please note, PWM will be always send out the PWM wave, so the edge will always happen, if your PWM not stop, the ADC trigger also will happen.

Then, if you want to stop the ADC trigger, you need to disable the PWM wave, or you can use the software trigger ADC instead of the hardware trigger, then you can use the software code to control the ADC is triggered or not.

Wish it helps you!

If you still have question about it, please kindly let me know.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos