TPM trigger sinchronization

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

TPM trigger sinchronization

Jump to solution
1,688 Views
Claudione
Contributor I

Good mornig.

I have a very simple application using, the tpm module.

I'm reading 3 thermocouples to control 3 littles oven by the pwm generated from tpm module.

Everything works properly but I need to synchronize the beginning of the pwm with the zero crossing point from the net power.

I get this control, from an input pin selected as input capture.

The target is a FRDM-KL25Z board.

I don't understand how to synchronize it.

Is there anyone to explain me how to this synchronization  ?

Best regards.

Claudo

Labels (1)
0 Kudos
Reply
1 Solution
1,439 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claudio,

     Now what do you want to synchronize? I still don't full get what you are wanting? Could you describe your function in details?

    Do you wan to use the FTM0_CH5 (PTD5) as the rising input capture edge, and FTM0_CH0,FTM0_CH1,FTM0_CH2 as the PWM output pin, then use FTM0_CH5 to caputer the FTM0_CH0,FTM0_CH1,FTM0_CH2 PWM risng signal? Now the problem is you missing the first rising?

    If yes, you can reconfigure your PWM wave, make the first rising coming in the later PWM cycle, or you use FTM1 channel as the capture.

   Please give me more details!

Waiting for your reply!

Jingjing

View solution in original post

0 Kudos
Reply
6 Replies
1,439 Views
Claudione
Contributor I

HiJingjing

My idea is this.

As you can see from the simple draw,  I have the zero crossing signal. This signal must synchronize the pwm start output. It was my choice to wire the zero crossing signal like input capture function but may be another input just to synchronize.

At the moment my pwm output work properly. I don’t’ have any problems. I change the duty value without difficult and everything works good. But I am not in phase with the main supply. My problem is to understand what I have to do to synchronize the beginning of every pwm output.

Hope the below simple immage can help you.

Thank you very much.

Claudio

Synch.JPG

0 Kudos
Reply
1,439 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Cluadio brunelli,

    Thank you for your image!

    The zero crossing wave is for FTM0_CH5(PTD5) rising capture edge? When capture the rising edge, you will output the PWM wave in PTC1-3, but you find the output PWM wave the rising edge have the time delay with the zero crossing wave? What the delay phase you are meeting now? and what the smallest range you are wanting?

    Because after capture the zero crossing, then output the PWM, it must have some time delay, what we do now is just shorten the phase delay time to the smallest.

    I suggest you configure the FTM clock as the fastest clock, and use the capture interrupt to enable the PWM output, this will minimize the delay time.

Wish it helps you!

If you still have question, please let me know!

Have a great day,

Jingjing

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,439 Views
Claudione
Contributor I

Hi Jingjing.

I took some time to have more details from data sheet !

At the end, the best way to do what I want is your suggestion or rather, to use PTM1 - CH0 as inpunt capture

to get the zero crossing, then to reload the counter of PTM0 cha 0..1..2.

Works perfectly now.

I thank you for your time.

Have a great weekend.

Claudio

0 Kudos
Reply
1,439 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Claudio brunelli,

    Please tell me how many TPM module you are using?

    If you just use one TPM module, and different TPM channel, it is easy to synchronize the beginning of the PWM.

    Just configure all the TPM channel, then at last select the TPM_SC_CMOD to enable the TPM module clock, this method will relize the synchronization of the PWM beginninng.

Wish it helps you!

If you still have question, please let me know!

Have a great day,
Jingjing

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

0 Kudos
Reply
1,439 Views
Claudione
Contributor I

Hi Jingjing Zhou

thank you for your time.

Yes I'm using one TPM module with different channel. They are FTM0_CH0,FTM0_CH1,FTM0_CH2.

On the FRDM-KL25Z board they are wired on PTC1, PTC2, PTC3.

The signal to synchronize is wired on FTM0_CH5 (PTD5) set for rising input capture edge.

I could change it if necessary.

Claudio

0 Kudos
Reply
1,440 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claudio,

     Now what do you want to synchronize? I still don't full get what you are wanting? Could you describe your function in details?

    Do you wan to use the FTM0_CH5 (PTD5) as the rising input capture edge, and FTM0_CH0,FTM0_CH1,FTM0_CH2 as the PWM output pin, then use FTM0_CH5 to caputer the FTM0_CH0,FTM0_CH1,FTM0_CH2 PWM risng signal? Now the problem is you missing the first rising?

    If yes, you can reconfigure your PWM wave, make the first rising coming in the later PWM cycle, or you use FTM1 channel as the capture.

   Please give me more details!

Waiting for your reply!

Jingjing

0 Kudos
Reply