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.

C2000 F28027 HRPWM Question



Dear all,

By now I was more working with Atmel AVR type microcontrollers and so it's still abit heavy for me to find and gather all the information for such a type of microcontroller.

I have a question if it is possible to realize the following using the high resolution pwm module of the C2000 launchpad. I need to create a periodic signal (period is in order of 1MHz to 100Hz). I need to fine control the rising and falling edge of the pulse with sub-ns precision. The signal itself should be synchronized to an external clock source in the order of 80MHz. The on-time of the pulse should be in the order of 100ns. For a simlar application I realized that functionality with an FPGA and some dedicated external parts. Now I read about the HRPWM module in the C2000 and was thinking about if I can utilize it.

What I got so far from the datasheet is that:

I can use an external clock source with the F28027 uC but max. 30MHz, o.k. I can use a frequency divider in front

I can use the HRPWM Moudle to generate such signals in general there are some limitations for example that fine control is only available within certain time windows of the PWM. If I remember correct it was something like 3 cycles after period starts and 3 cycles before period stops. So that then gives me some limitation of the input frequency of the module to still achieve 100ns pulse width with fine resolution control, correct?

I would need two of such signals, is it possible to create both with one HRPWM module, or do I need both channels to create one signal?

I hope you can help me to figure this things out, I already ordered one launchpad just to give it a try.

  • Hi thefloe,

    Based on your description, I believe what you want to do is possible.

    For clocking: I believe you have a workable idea.  I might recommend using a /4 divider so that 20MHz gets into the device.  You could then use the F28027's PLL and the PLL's /2 divider to have a number of good options to run the F28027.

    On the HRPWM time window limitations: Yes you are correct.  Depending on whether you are using up-count or up-down-count mode you will limit yourself to outputting a max of 20 or 10MHz respectively.  This seems out of your frequency range.  This limitation will also place a constraint on the minimum and maximum duty cycles that you can generate with hi-resolution enabled. 

    Unless the two waveforms you want to generate are the same signal (or are an inverted versions of each other), I would recommend using the A channel output of two separate ePWM modules to generate each signal.  If necessary you can synchronize PWM2 to PWM1 via some configuration register settings.


    Thank you,
    Brett

  • Hi Brett,

    Thank you for your answer.

    I was reading through the datasheet again and found the following line in the description of the HRPWM section (page 66):

    The minimum SYSCLKOUT frequency allowed for HRPWM is 50 MHz.

    How does this relate to the maximum specifications of SYSCLOCKOUT found later in the datasheet (page 88) where for 40MHz, 50MHz or 60MHz devices the corresonding maximum SYSCLOCKOUT is specified. How do I know which device I have nd the C2000 launchpad. And what is the use of the HRPWM when for 1 device it's outside specifications, for the second on the edge and only allowed on the third one. Sorry I'm really confused here.

    By now I see an option to use 2 channels, that are XORed external and use only the falling edge control. For the second signal I would then use the next 2 channels. 

    I think I shoukld stop thinking and just give it a try, as I already have the launchpad here. At this points thanks to TI for affordable launchpads!

    Thanks!

  • Hi thefloe,

    If you take a look at the hardware features per F2802x part number table (on page 7 of the datasheet), you will find which part numbers are specified to run at which max SYSCLK frequency.

    My feeling is that you may be able to generate each signal with one PWM each because the configurable in the PWM, but you'll need to evaluate.

    I think you're right, it's around that time to go ahead at delve into your launchPAD.  Good luck!


    Thank you,
    Brett