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 Calculation

Other Parts Discussed in Thread: HALCOGEN

Hi,

I would like to generate PWM signal with a frequecy of 50MHZ and duty cycle of 50%. Is it possible to generate it using NHEt module ? Can any one tell me what should be the values of VCLK2,hr and lr ? Please guide me how to calcualte the frequecy also.

Thanks in advance.

  • Hello Bindu Tanguturi,

    yes you can use the NHET module to do this. You can do this by using either the

    1) HALCoGen tool (the easiest way to do it)

    After installing/opening HALCoGen => Help => Help Topics => Examples => example_hetPwm.c. It is explained how to set up a PWM with 50% duty cycle for a particular NHET channel. You first have to set up a HALCoGen project (use the workspace of CCSv4 as save folder), then you need to set up a project in CCSv4 with the same name like the HALCoGen project, the files will be populated automatically.

    2) HET IDE (more effort but with waveform check ability)

    In the following application note it is explained how to generate a particular PWM (duty, hr, lr, HRP, LRP) in detail with all the calculations necessary by using the HET IDE and then import the HET code into CCSv4.

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraba0b

    I would recommend to install both tools. Can be very helpful generating the basis for further software development. If you have any questions arising during testing above methods let me know.

    Best Regards,

    Gregor

  • thanks Gregor.

    I have all these tools installed. The link given for the application note should help me for calculations.

    One quick question. Can we generate PWM signal of 50Mhz frequecy of 50%duty cycle as the maximum clock available is 80Mhz ?

  • Hello Bindu Tanguturi,

    I do not think that this is going to work. The maximum VCLK2 frequency (TMS570) is given with 100 MHz. But even if you would adapt your PLL settings in HALCoGen => Clock Tree the maximum frequency of PWM with 50% duty cycle would be about 25 MHz (minimum LR time would be 10 ns the same as HR time, lr = 0, hr = 0). I do not think that this is going to be enough for a simple PWM generation using 2 NHET instructions.

    You could use the HET IDE to simulate with the calculated values like described in the NHET Getting Started application note and see what the maximum possible frequency can be using 80 or 100 MHz as clock for the HET.

    HET IDE => right click on project => project properties => clock => set HET clock freq, lr and hr.

    Sorry I thought it was 50 kHz in your first post.

    I hope this helps. Let me know if something is unclear to you.

    Best Regards,

    Gregor

  • Thanks Gergor. I was thinking the same that generation of 50MHZ is not possible. I will also check the IDE for the max limit.

    Thanks again.