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 HET Instrucation ECMP

Hi there,

I have a few questions regarding ECMP.

1) In Section 18.7 of TMS570 TRM (Page 1358), I saw "Enable Pin action" and "Opposite action" in the execution algorithm of ECMP. Are they bit 4 & bit 3 of the Control Field of ECMP (e.g. C[4] Enable Pin Action & C[3] Opposite Pin Action)? Is the combination of the two bits, C[4:3], defines the action type?

2) When the action type of ECMP is set to PULSEHI and the Z Flag is set by CNT, the specified pin (e.g CC0) will change its logic state from high to low, right?

3) Does this pin opposite action apply in the case where the action type of ECMP is set to PULSELO? The reason I am asking this question is because C[4:3] = 11b for PULSEHI and 10b for PULSELO, and if C[3] is the Oppostite Pin Action, then the pin opposite action is supposed to take effective for PULSEHI, but not for PULSELO.

Thanks a lot,

Brent Shen

  • Hello Brent, Thanks for posting.

    1. Bits C4:C3 control the action of the pins, from one of the following: [action={CLEAR | SET | PULSELO | PULSEHI}], "Enable pin action" is bit 22. I am trying to get more details on what controls the "opposite action".

    2. Correct. As shown in the example on page 1255, after Z is set, on the next loop resolution cycle the pin will change the state from high to low.

    3. The opposite would also apply to PULSELO.

    I will confirm the details of "opposite action" and add to the post.

    Best regards,
    Diwakar

  • Brent,

    The opposite action is taken at the next loop clock edge when the cnt instruction reaches the max specified value.

    So yes it applies to any action.

    Regards,

    Jean-Marc

  • Hi Jean-Marc,

    Thank you for the info above. I have one more question. If a pin action of PULSEHI is specified by ECMP, is the initial logic state of that pin (before the action is taken) logic low? Similiarly, if a pin action of PULSELO is specified by ECMP, is the initial logic state of that pin logic high? I don't have to use some other instruction to set the initial logic state of that pin before using ECMP, right?

    Thanks a lot,

    Brent Shen 

  • Hello Brent,

      Regardless of the PULSEHI or PULSELO the default state of the pin is initially low after reset. You can initially set the pin high manually by writing to DATAOUT register and use the PULSELO so that when there is a compare match by the ECMP, the pin will go low and go back high when opposite action is taken which is when the Z flag is set. If you don't initially set the pin high using DATAOUT register and use the PULSELO then you will just need to wait for the CNT instruction to expire the virtual counter once and afterward everything should work accordingly.

     

    regards,

    Charles