This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48l952 PWM sync

Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm generating 3 different pwms using Nhet1, pwm0,pwm 2 and pwm 3.

They work all fine, I can change the duty cycle and start/stop them.

I'm using Halcogen software generate code to control them.

Pwm0 and Pwm3 can be on at the same time, but not PWM2.

Same thing, PWM2 and PWM3 can be on at the same time but not PWM0.

No problem here, I can enable or disable them.

My issue is that I would like to make sure, when 2 pwms are on, that the signal generated is synched.

So, if I start PWM0 with a 50% duty cycle, then I start PWM3 with a 50% duty cycle, how can I be sure that the 2 pwms waveform is exactly synched?

Thanks for your help

Giorgio

  • Hi Giorgio,

      I'm not too clear on your question that you want two pwms to be in sync. The two PWMs can potentially have different period and duty cycle from each other, right?. Or the two PWMs you have will have the same base period but with different duty cycle or the base period of one PWM is a multiple of the other. In this case, you should see one edge of the two PWMs aligned to each other. 

      Or your question is supposing that the two PWMs have the same period and duty cycle but you need to use the pwmStart() to start each PWM one at a time. You are questioning if both of them will have the same first edge happening at the same time. if this is the question then it is possible that the second PWM that you initiate using the pwmStart() will have some delay. What you might see is that the second PWM's first edge starts at the second period of the first PWM but subsequently  both PWMs will be synchronized to each other identically. 

  • Hi Charles,

    Thank you for your answer.

    Yes, as you correctly answered the PWMs have the same period and duty cycle and they are started with pwmStart() one after the other.
    I'm glad to know that they are going to be synchronized to each other identically starting from the second period. This is the answer I was looking for.

    Thanks again for your help.

    Giorgio