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.

Problems setting up a HR delay when the action in an ECMP instruction is different from PULSEHI/PULSELO

HETPFR[31:0] register = 0x301

This works fine:

L00 CNT {next=01h, reg=A, irq=OFF, max = 4 }

L01 ECMP {next=L02, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=PULSEHI, irq=Off, data=1, hr_data=0x10}

L02 ECMP {next=00h, en_pin_action=ON, cond_addr= 00h, pin=CC0, action=PULSEHI, reg=A, irq=OFF, data= 1 }

This one doesn't:

L00 CNT {next=01h, reg=A, irq=OFF, max = 4 }

L01 ECMP {next=L02, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=SET, irq=Off, data=1, hr_data=0x10}

L02 ECMP {next=L03, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=CLEAR, irq=Off, data=4}

L03 ECMP {next=00h, en_pin_action=ON, cond_addr= 00h, pin=CC0, action=PULSEHI, reg=A, irq=OFF, data= 1 }

Is it suppose to work with SET/CLEAR as well? I am using the SM470R1B1M-SK eval board from IAR.

Thanks in advance.

Giuseppe

  • Giuseppe,

    Our subject matter expert will get back to you on your query.

     

    -Hercules Forum support

  • Giuseppe,

    In your second example I see 2 HR instructions acting on the same pin (CC2).   This isn't allowed;  in each loop you can only execute one instruction for each pin that

    has HR_LR = high.  The 2nd won't be executed.

    -Anthony

  • What you can do is:

    Giuseppe Ameno said:

    HETPFR[31:0] register = 0x301

    This works fine:

    L00 CNT {next=01h, reg=A, irq=OFF, max = 4 }

    L01 ECMP {next=L02, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=PULSEHI, irq=Off, data=1, hr_data=0x10}

    L02 ECMP {next=00h, en_pin_action=ON, cond_addr= 00h, pin=CC0, action=PULSEHI, reg=A, irq=OFF, data= 1 }

    This one doesn't:

    L00 CNT {next=01h, reg=A, irq=OFF, max = 4 }

    L_temp MCMP  { next=L01,hr_lr=LOW,en_pin_action=OFF,cond_addr=L02,pin=3,order=REG_GE_DATA,reg=A,data=2};

    L01 ECMP {next=L03, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=SET, irq=Off, data=1, hr_data=0x10}

    L02 ECMP {next=L03, reg=A, hr_lr=HIGH, en_pin_action=ON, pin=CC2, action=CLEAR, irq=Off, data=4}

    L03 ECMP {next=00h, en_pin_action=ON, cond_addr= 00h, pin=CC0, action=PULSEHI, reg=A, irq=OFF, data= 1 }

    The MCMP instruction will force the ECMP instruction be executed only once on pin CC2. This is a typical way to generate a symatric Pwm using HET. data=2 is the center of the pwm.

    Is it suppose to work with SET/CLEAR as well? I am using the SM470R1B1M-SK eval board from IAR.

    Thanks in advance.

    Giuseppe