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.

N2HET

Is it possible to turn on two pins in N2HET

i.e. pin=0,10 in an MCMp or ECMPiinstructions

  • Raj,

    No each instruction can act on a single pin.

    If you need to act on 2 pins, you have to copy the same MCMP or ECMP twice but use different pin #'s in the pin=field.

    Be a little careful though with registers being modified by the instruction.

    For example MCMP may modify the T register if 'save sub' is set. (See the instruction set description for the N2HET in the TRM, under the MCMP instruction. You'll see a 'Register Modified' heading and it'll tell you this.

    If you are comparing against T in both the MCMP instructions and you write T back, then T for the 2nd copy of the MCMP will be wrong.
    So you may need even additional instructions .. like don't use the savesub bit but instead use a discrete SUB instruction and write the result to a different register.

    In any case, it's good to simulate the instructions you duplicate and look for this type of problem before going to the chip. A lot easier to debug in the HET IDE.