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.

NHET PWM output

Hi,

I am using the TMS570 XDS560 emulator with a TMS570LS20216ZWT.

I am using a simple NHET program to generate a clock output on NHET pin 24.

My NHET code is as follows:

L00: CNT{next = L01, reg = A, max = 7};
L01: MCMP{next = L00, reg = A, en_pin_action = ON, hr_lr=HIGH, pin = CC24, action = PULSEHI, order = REG_GE_DATA, data = 0x3, hr_data = 0x0};

The value of HCLK (and NHET clock with VCLK2R = 0) is set to 125MHz.

I thought that with a count of 7, the PWM frequency should be 17.58MHz, but I am getting an output of 1.95MHz.

Ideally I am looking for a clock output of 16MHz.

Regards,

Dave

  • Please check your HETPFR (at 0xFFF7B804) register. Suppose it is 0x300, then, the LRP=8HRP=8VCLK2.

    The output frequency will be:

    125MHz / 8 / (7+1)=1.95MHz

    Here 7 is the counter max value in your instruction.

    If you want a 16MHz clock, the best way to get it is using the ECLK pin. Suppose your VCLK is 80MHz, dividing it by 5 will get 16MHz. By the way, 125MHz VCLK is out of datasheet.

    Regards,

    Haixiao