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.

Use of NHET on TMS570 - PULSE Output

Hello all,

Firstly, I apologize for hijacking this thread - my first post and I really struggled to find where to create a new post/thread..!

anyway, I am struggling to understand why a relatively simple clock of HET code isn't working. The following is meant to output, on pin 0, ten high pulse of increased size each time. It is not complete (as it is here it'll do ten pulses and then nothing more), but it doesn't work as it is. All I get out is one single high pulse.

L00   DJZ    { next=L01, cond_addr=L03, reg=A, data=100};
L01   ECMP   { next=L00, cond_addr=L02, en_pin_action=ON, pin=0, action=PULSEHI, reg=A, data=10};
L02   DADM64 { next=L00, remote=L01, cond_addr=L02, comp_mode= ECMP, pin=0, en_pin_action=ON, action= PULSEHI, reg=A,data=10};
L03   MOV32  { next=L00, remote= L00 , type=IMTOREG&REM, reg=NONE, data= 100}

Thanks in advance of your help !!

  • Todd,

    I split the thread for you.

    I believe the issue is that you are using the "PULSEHI" action which relies on executing the ECMP twice in order to make the pin go high and low:

      a) execute ECMP when there is a match between data and Reg A to set the pin high

      b) execute ECMP when the Z flag = 1 to set the pin low again (opposite action)

    It appears that you jump *around* the ECMP instruction in the cond_addr=L03 of the DJZ instruction.
    So I think your pin gets set high but never gets set low.

    A more 'normal' way to build this type of counter would be to replace the DJZ with a CNT instruction.

    You can set the CNT max=100 to achieve the same thing as your DJZ except the count will increment instead of decrement.  You also don't need the MOV32 with the CNT since the reset is built into the CNT instruction.