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.

TMS570LC4357: NHET doesn't throw interrupts

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm having problems using the N2HET module. I want to throw an INT with a RISING edge on the pin NHET[31]. When I use the HALCOGEN autogenerate micro-code it works but when I use my microcode it doen't work, I read as much as I could but I'm not being able to find where is my mistake. I added irq=ON, after that I tried adding request but it didn't work. 

this is my asm

;-------------------------------------------
; Assembler option
;-------------------------------------------
-hc32
-n0
-v2
-AID1.7
;-------------------------------------------
; CNT 1 or 2 cycles (1 cycle if angle_count OFF)
; WCAP 1 cycle
L00: CNT    {
                reg=A, max=01ffffffh, angle_count=OFF,
            }        
L01: WCAP   {
                next=L00, cond_addr=L00, 
                hr_lr=high, reg=A, data=0,
                event=RISE, pin=31, 
                IRQ=ON, request=GENREQ,                
            }

My result code

const hetINSTRUCTION_t examplePROGRAM[2U] =
{
     /* L00_0 */
     {
         0x00002C20,
         0x01FFFFFF,
         0x00000000,
         0x00000000
     },
     /* L01_0 */
     {
         0x00001600,
         0x08001F41,
         0x00000000,
         0x00000000
     }
};

And I'm going to attach a generic het.c autogenerated by HALCOGEN, I'm just replacing the microcode in the function hetInit() line 1323

(void)memcpy((void *)hetRAM1, (const void *)het1PROGRAM, sizeof(het1PROGRAM));

instead to use het1PROGRAM I use examplePROGRAM. 

5582.HL_het.c

  • Hi Hector,

    Is there a low-to-high transition on the HET[31] terminal? Is the interrupt condition detected inside the NHET module itself? Do you see the interrupt flag being set in the HETFLG register? The request generation is for the HET transfer unit to transfer the data from the WCAP instruction to the CPU RAM. You can add this functionality later once you have the interrupt detection working.

    Regards,
    Sunil
  • Hi Sunil,

    Thanks for your answer. 

    My system is running, It has a periodical signal in pin31, I want to measure the time between two signals using the rise edge.  Using the HALCOGEN microcode program, I could get an INT and get the time elapsed between two rise edges.

    In this running system, using all the same HW, same HET config, If I just change the microcode for the code I've posted before, I don't get an INT, I have breakpoints in the handler. So I believe that my problem is in the microcode, but I'm not sure, and I cannot realize what is wrong.

    _|  |____________|  |_

      < time elapsed  >

    Regards
    Hector

  • Is your problem resolved? You stated that you got the correct elapsed time using the microcode generated by HALCoGen. Please let us know if you have any other issue.

    Regards,