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.

PWM with phase shift in RM42x

Other Parts Discussed in Thread: HALCOGEN

Hello,

I wish to generate 3 PWM's which are out of phase with each other. I used the pwmStart function for each of the 3 PWM's delayed by the function delay(). It is shown below:

hetInit(); pwmStart(hetRAM1,pwm1); delay(); pwmStart(hetRAM1,pwm2); delay(); pwmStart(hetRAM1,pwm3);

While debugging, I found that all the 3 PWM's start simultaneously after the first pwmStart instruction itself, rendering the delay() function useless. Where am I going wrong with this method? 
Is there any better alternative to this approach?

Thanks and Regards, 
Nimit.
  • Hello Nimit,

    I have forwarded your question to one of our NHET experts who should be able to provide you some guidance in how to achieve the desired results.

    In general, I don't think you will be able to realize the delayed start using code outside of the NHET program. You will need to build the delay into the NHET program itself based on the HR and LR loop counters. This implementation will not be possible with the simple Halcogen PWM generation utility. The expert should be able to get back with you shortly to walk through this process.

  • Nimit,

    The PWM generation from Halcogen does not have the capability to insert delay from one PWM to another.

    The PWM codes generated from the Halcogen will be started at the same time whenever you start the NHET.

    Therefore, the delay() external function that you have will not delay the other PWM.

    Do do this delay, you have to write codes at NHET level.

    I am attaching an example of having 2 PWM to control the voltage booster that has to be triggered in a fixed phase offset.  Please notice that this is just an example codes in an arbitrary requirement.

    But you can play with it and learn from it.

    Hope this helps you.

    6886.PWM_PHASE_SHIFT.zip