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.

CCS/TMS570LC4357: HALCoGen Settings do not seem to be respected in the final Debug

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello, 

i am currently setting up the N2HET module of my board in order to have a HET interrupt every 100 us. To do so I set up my the HET1 through HALCoGen as shown in the fig1. HALCoGen Settings

Then I go on to set my pwm0  as shown in fig 2 

Pwm0 Creation

and my interrupts as shown in fig 3 ( which I have enabled in the VIM part) ( I get interrupts alright just at the wrong time) 

Interrupt Creation

All of this creates the het.c file ( I copied into my CCS project all the files regarding the het: het.h/reg_het/stdnhet.h/ het.c)

I added a counter so to have a notification every 5 ms ( 100*50 = 500us = 5ms) 

My project builds and debugs all right on my board but I get my pwm notification variably but precisely every 3 or 4 ms. 

I have checked the conditions on my pwm based on the prescalers and it should be a frequency that is congruent with my CLK settings. 

thank you for you help

  • Hello,
    Please verify that HET program fits in the Loop resolution clock period, in your case 100ns and no Program overflow condition occurs.

    Best regards,
    Miro
  • how do I do that ? I didn't write the program myself in the HED IDE, HALCoGen created it automatically

    I know how to calculate the maximum number of instructions for my LRP but I don't have any reference on how to see if this condition occurs. 

    Is there a register value I can pull from the software ?

  • Hello,
    HALCoGen generated HET program takes about 800ns. Try with setting Loop resolution clock period to 800ns.
    Bit 0 (PRGM_OVERFL_FLAG) of HETEXC2 is set when Program overflow condition occurs.


    Best regards,
    Miro
  • I did as you said and augmented the LRP as you can see from the images. I now get interrupts every 170/1 ms (with the counter at 50 interrupts). Which is still imprecise at most a a milliseconds. Since the Pwm should have a period of 100 us it seems wrong anyway.

  • Hello,
    I made tests with default HALCoGen HET1 settings (HR Clock 110MHz, VCLK2 75MHz, Loop Time 800ns) and in every 5ms pwmNotification is called. How do you measure period for calling notification?

    Best regards,
    Miro
  • i was willing to try that too but I get some problems when I create my project in CCS. 

    the steps I covered were:

    - create HALCoGen project and the generate the files

    - create my CCS empty project with the same directory as the HALCoGen one.

    - I then build my project but it seems that some files are missing from the project itself

    I checked and there are no such files in the directory HALCoGenCreated so why are they asked to be included ?

  • anyway to address your question on how I calculate the time for the pwm my software sends a message at every pwmnotification, thus I was expecting some delay but it should be a constant delay if the notification come always at the same period. 

    I run everything on Mac could HALCoGen run through a virtual machine be faulty ? 

  • Hello,

    In my tests I toggle a pin in notification and observe it on oscilloscope. This is not the best way to measure the time between interrupts but is accurate enough in this case. You can use PMU for more precise measuring.

    Best regards,

    Miro