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.

HALCoGen version 3.00.00

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

I encountered the following problems with HALCoGen version 3.00.00 for the TMS570LS3137:

- The generated file sys_core.asm enables all interrupts, incl. the fast interrupts („cpsie if“), at the beginning of the start-up. Why?

- The channels 16 to 23 of the ADC1 group 1 can be enabled, but the converted values are always 0 and the conversion takes 0ns (according to HALCoGen).

- I would like to start an ADC1 and 2 group 1 conversion on every RTI compare 0 interrupt using the HW trigger. How shall I configure HALCoGen?

  •  

    Daniel,

    Let me answer the last question first. You should be choosing the HW trigger from the default trigger source .Refer the attachment.

    I need to check on your observation on #2.

    Do you see any issue with your observation on #1 at the moment , although I will check if there is an option to disable the interrupts through the GUI.

    -Pratip

  • Hi Pratip

    To Q1: The application doesn't always start-up (without debugger connected).

    To Q3: I tried your HALCoGen configuration with ADC 1 Group 1 instead of group event and the conversion isn't started.

    Thanks Daniel

  • Daniel,

    On Q3 : Can you send me the generated adc file , which trigger are you using for Group 1 ?

    On Q1 : Can you explain what you mean by app doesnt start-up without debugger connected ?Are you able to get upto main() without any issues ?

    Regards, Pratip

     

  • Pratip,

    On Q3: See attached file adc.c. I use RTI compare 0 as HW trigger for both ADCs.

    On Q1: The application doesn't start-up after a power on reset or power supply off - on cycle. Only when I debug the application or if I remove the interrupts enabling in the _coreInitRegisters_, it starts-up!

    Regards, Daniel

  • Daniel Dueringer said:

    Pratip,

    On Q3: See attached file adc.c. I use RTI compare 0 as HW trigger for both ADCs.

    On Q1: The application doesn't start-up after a power on reset or power supply off - on cycle. Only when I debug the application or if I remove the interrupts enabling in the _coreInitRegisters_, it starts-up!

    HW: This is due to the CCMR4 errata. It will be fixed in RevB. Anyway, I don't think the interrupt can be enabled before the ISR is initilized. The way that interrupt is enabled in HalCoGen 3.0.0 is NOT recommended. Try this:

    1. Comment or delete ‘cpsie if’ in sys_core.asm

    2. Add following code in sys_startup.c
    /* USER CODE BEGIN (14) */
    esmREG->ESTATUS1[0]=0x080000000;
    esmREG->ESTATUS1[1]=0x000000004;
    esmREG->ESTATUS2EMU=0x000000004;
    esmREG->KEY=0x05;
    /* USER CODE END */
     
    And after your code enter sys_main.c, enable the interrupt:
     asm(" cpsie if");
     
    This is the workaround when I use HalCoGen 3.0.0. If the pin nTRST is pull high, you might still get the problem of "Can not startup". This is another bug that will be fixed in RevB too.

    Regards, Daniel

  • Is your change of sys_startup.c:

    /* USER CODE BEGIN (14) */
    esmREG->ESTATUS1[0]=0x080000000;

    esmREG->ESTATUS1[1]=0x000000004;

    esmREG->ESTATUS2EMU=0x000000004;

    esmREG->KEY=0x05;

    /* USER CODE END */

    due to the errata DEVICE#140? You do more than the workaround tells.

    Thanks, Daniel

  • Yes. I did more than the workaround in Errata and I think it is necessary, becasue:

    Core compare error  triggers both the core compare error flag and CCMR4 selftest flag. So, we need to clear both of them (1st and 2nd code). Meanwhile, we should clean the shadow register (3rd code). The 4th code tells the module driving high the nError pin after some time.

    By the way, I did not see the 2nd problem. In my code, Chan 19 is used in my project as ADC1 Group1, ADC1 Group2, HalCoGen 3.0.0 works fine in this case.

    Regards,

    Haixiao

  • Q1: Is ok, thanks!

    Q2: Channels 0-23 of the ADC1 are converted, but the time to convert all channels isn't correct in HALCoGen.

    Q3: Is still not working ...

  • For the RTI compare 0 interrupt to trigger the ADC, the RTI module needs to be configured to generate the interrupt. Also, the ADC conversions are edge-triggered so that the RTI compare0 interrupt must also be cleared before it can be used to trigger the ADC again.

    Please confirm that the RTI is configured to output an interrupt. The interrupt need not be enabled inside the VIM. Do you see the RTI interrupt flag getting set in the RTI module?

    Regards, Sunil

  • Daniel,

    As discussed offline, the solution to use the ADC HW trigger is to run "adcStartConversion()" once for the conversion group.

     

    Thanks,

    Christian