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 NHET IDE: Why "Program Overflow has occured"

Hi there,

I wrote a short 4-instruction NHET program (below), and VLCK2 driving the NHET device is running at 50 MHz, with HR=1 and LR=4.

 

L00 CNT  { next=L01, reg=A, comp=EQ, irq=OFF, max=0x1FFFFFF }   

L01 CNT  { next=L02, reg=B, comp=EQ, irq=ON, max=32 }   

L02 WCAP { next=L00, cond_addr=L03, reg=A, pin=CC0, irq=OFF, event=BOTH, request=GENREQ, reqnum=0, hr_lr=HIGH, data=0, hr_data=0 }   

L03 MOV32 { next=L00, reg=B, remote=L01, type=IMTOREG&REM, data=1 }

 

As we can see in accordance with the Technical Reference Manual, both CNT are in timer mode by default, which should take up 1 HR each to execute; WCAP is taking 1 HR and MOV32 with type=IMTOREG&REM is also taking up 1 HR, for a total of 4 HR when taken (max for this short program).

However, despit the fact that I have LR set to 4, when I simulate this program within the HET IDE, when condition of WCAP is satisfied and jump to MOV32, I received the following error:

 

 

Can someone please tell me what I've missed?

Thank you!

 

  • Moreoever, I don't know if this is relevant, when executing "Compile and load", the partial disassembly output is not exactly the same as the original intente of the instructions of the original post, "comp=EQ" has been changed to "comp=GE".

    Can anyone shed some light on this one as well?

     

     

  • Chuck,

    In the NHET documentation on page 763 of RM48x there is a definition for Program Overflow.

    There is no Overflow when the Program returns to address 0 before the start of next loop resolution.
    That means, in your case you have 4 time slot -1 to execute and return to start. 

    For your code to execute correctly, you will have to increase the number of time slot to 8.

  • Jean-Marc,

    Thank you for the reference. This page number should be at page 909 rather than 763 though. I suppose that the NHET presented in the TMS570 has the same architecture of the N2HET of RM48x.

    Can you please take a look on my post #2 regarding the discrepencies of compiled instruciton vs dissambly?

    Thanks.

     

  • Chuck Wong said:

    Moreoever, I don't know if this is relevant, when executing "Compile and load", the partial disassembly output is not exactly the same as the original intente of the instructions of the original post, "comp=EQ" has been changed to "comp=GE".

    Can anyone shed some light on this one as well?

     

     

    I think that I found a bug in HET IDE v3.3. Below are my findings:

    If you put "comp=EQ" the corresponding dissambly displays "comp=GE"; If you put "comp=GE" the corresponding dissambly displays "comp=EQ". The generated Program Fields of the CNT instruction in "C" code are however correct in both cases.