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.

TMS570 PWM setting in HalCoGen

Other Parts Discussed in Thread: HALCOGEN

Dear TI guys,

within HalCoGen (version 03.03.01) there can be set 8 PWM channels - AFAIK all 32 NHET pins/channels might be used for 32 different PWM signals. Is that right? Afterwards the tab "Pwm 0-7" can be perceived as non-complete but inspirational one, cannot? However, the amount of PWMs (=8) advises me that it was not chosen accidentally... ;-)

A period in this tab is editable and the shortest value which can be entered is 3.2us regardless defined value of VCLK2. It means maximal PWM frequency 312.5kHz.  Of course, I am happy enough with this value. But theoretically I would expect e.g. 160MHz if VCLK2=160MHz, hr=1 and lr=1. OK, ithis extreme example is meaningless due to timeslots equal to one VCLK2 tick - one NHET instuction can be executed. However, why there is the limit of 3.2us?

Many thanks in advance,

Best regards

Jiri

  • Jiri,

    N2HET cannot run faster than 100Mhz. (VCLK2)
    In Halcogen the default Clock for the CPU is 160Mhz (GCLK and HCLK) so VCLK2 has to be divided by 2 = 80Mhz.

    The Loop Resolution (LR) will give you the resolution for your PWM.
    Depending on how many instruction your NHET program needs, you will have to tune the LR.

    Check the example in chapter 19.2.3.1 Determining Loop Resolution of http://www.ti.com/lit/ug/spnu499/spnu499.pdf for additional details.

  • Hello Jean-Marc,

    thanks for your hints. Nevertheless I would like to ask you for further explanation and some limits given by N2HET (in general and by options within HalCogen IDE).

    N2HET cannot run faster than 100Mhz. (VCLK2)

    Unfortunately, I have not found this value within any available documentation - of course, maybe my oversight.

    Previously I wrote:

    >> AFAIK all 32 NHET pins/channels might be used for 32 different PWM signals. Is that right? Afterwards the tab "Pwm 0-7" can be perceived as non-complete but inspirational one, cannot?

    Is the limitation of 8 PWM channels determined by a HalCoGen structure or by an included template (of C and H files modified via HalCoGen IDE)? Or is there any architecture limit of N2HET that I have missed? Theoretically, can all output pins of N2HET be set as PWM outputs. Yes, a size of microprograms has to be considered within the range of aprx. 2KBytes (160*96bits) N2HET RAM.

    By the way, does a structure of HET_MEMORY (in file std_nhet.h) not waste memory space (padding reserved_word inserted within the structure) if that is aligned to even 32-bit word? It would lead to unused 160*32bits , would not?

    My next question was:

    >> A period in this tab is editable and the shortest value which can be entered is 3.2us regardless defined value of VCLK2. It means maximal PWM frequency 312.5kHz.  

    Is this border just given by an internal setting of HalCoGen (by a default values within some templates) or does it refer to some principle limitation of N2HET architecture?

    If I calculate correctly, then such loop resolution (LRCLK = 3.2us) can correspond with following setting which could be often used:

    GCLK = 160MHz; VCLK2 = 80MHz; hr = 2; lr = 128 ---> it defines 256 timeslots (cycles) for instruction execution per loop

    Well, too many questions within one post - some of them maybe silly; hopefully, most of them are a bit reasonable ;-)

    Many thanks for any comments in advance,

    Cheers, Jiri

  • Another remark - in the device TMS570LS3137ZWT there are two N2HET modules;

    I) N2HET1 consists of 32 (configurable - IN/OUT-put) pins

    II) N2HET2 consists of 19 (configurable - IN/OUT-put) pins -- 6 of those pins are "shared" with N2HET1 module

    So there are 32 + (19 - 6) pins available for N2HETx modules - so theoretically, can up to 45 output PWM signals be "simultaneously" generated with the ZWT device (BGA package)?

    Thanks in advance,

    Cheers , Jiri

  • Hello,

    >> AFAIK all 32 NHET pins/channels might be used for 32 different PWM signals. Is that right? Afterwards the tab "Pwm 0-7" can be perceived as non-complete but inspirational one, cannot?

    I have been informed that the number of PWN signals (== 8) within HalCoGen is just a feature of this tool - that is not a real limit.