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.

TMS570LC4357: N2HET Pulse Generation: 4µs Pulse Width, 20µs Period

Part Number: TMS570LC4357

Please help me for writing a N2HET instruction to generate a pulse with width 4 micro seconds for every 20 microseconds period for TMS570lc4357 controller. (For every 20 microseconds, a trigger on the pin high to low should occur and after 4 microseconds, the same pin should become low). I tried with the below code, but it is not generating the pulse for every 20 microseconds. The pulse is shifting from 20, 42. 65..., (the LRP is 1 microsecond and HRP is around 266.7ns)

P01 CNT { next=P02,request=GENREQ,angle_count=OFF,reg=B,comp=EQ,max=22,data=0};
P02 ECMP { next=P01,hr_lr=HIGH,angle_comp=OFF,en_pin_action=ON,pin=11,action=PULSEHI,reg=B,data=19};

  • Hi Karthik,

    Did you try the "insert PWM" option in HET IDE?

    Using this option, you can generate a PWM with required period and duty cycle.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish, thank you for your response. Yes I had tried that approach. Unfortunately, the rising edge of the pulse is not starting at every 20us period. I tried with the edge as "PULSELO" option but no improvement. Please let me know if you have any other solution for this.

  • Hi Karthik,

    Your duty cycle value looks wrong. If you want 4us TON on total of 20us pulse width, then the duty cycle percentage should be 20% (4*100/20) right?

    And also, here you trying to verify that first raising edge should be exactly after 20uS right? Maybe that will not happen because here we just trying to generate the 20uS total pulse width 4uS TON period but the starting of this pulse can be at any time based on the initialization part of the code and we can't guarantee to generate exactly at 20uS. The thing you should need to verify here is that whether the generated waveform have total period of 20uS or not for each pulse and you can also verify that whether it have TON is 4uS or not. 

    --
    Thanks & regards,
    Jagadish.