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.

HET PWCNT Instruction

Hi All,
 
How do i generate PWM using PWCNT instruction in HET?
Pl help..
 
  • The application note with example posted in TMS570 website can help you to generate the PWM step by step (using instructions CNT and MCMP).

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

    PWCNT is good at generating a single pulse. This instruction does not reload the counter when the counter value reaches zero. If you want to use PWCNT to generate PWM, you have to reload the data field by R4F CPU or using the MOV instruction. It is very complicated.

    Regards,

    Haixiao

  • Thanks for the reply.
    This is with reference to the document suggested.

    hr data holds the high resolution delay.Why do we need that?
    what is the need for HR data filed?

    In the example given (In page 3)
    If loop resolution prescale divide rate is 8, it means there are 8 HR clock cycles in one LRP.
    But why should we multiply the calulated value with 16?

    Also if the calculated value is left shifted by 4, then data field should be 0x1D4.
    How did we get 0x1DA?

    I am trying to understand the concept. Please clarify.

  • hr data holds the high resolution delay.Why do we need that?
    what is the need for HR data filed?

    HW: The HR data field is used to get a precise PWM. In that example, if you don't HR field, you can only get a duty cycle close to 25%, not exact 25%. In other words, HR data field help you to generate a pulse to the accuracy of high-resolution clock cycles, otherwise, you can only generate a pulse to the accuracy of low-resolution clock cycles.

    In the example given (In page 3)
    If loop resolution prescale divide rate is 8, it means there are 8 HR clock cycles in one LRP.
    But why should we multiply the calulated value with 16?

    HW: There are 7 HR data fields in TMS570. Since the prescale rate is 8, which means only the high 3 bits of HR is valid, We need to add four zeros for the lower 4 bits, 2^4=16.

    In TMS470M, there are 5HR data fields. The configuration will be different in this case.

    Also if the calculated value is left shifted by 4, then data field should be 0x1D4.
    How did we get 0x1DA?

    HW: It should be 0x1D4, thanks for catching that. I will let the author know and correct this typo.

    I am trying to understand the concept. Please clarify.

    Regards,

    Haixiao