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] HET work on V03.06.00, But NOT work V03.08.00, V03.08.01 and V03.09.00

Other Parts Discussed in Thread: HALCOGEN

I used HalCoGen V3.06.00 to generated code.

I used HET to count pulse and it work good.

 After I update HalCoGen Version V3.8.0~V3.9.0 , the couter always read "0" .

Follow functions are used:

hetInit();   --> to init HET

edgeResetCounter(hetRAM1, edge0);  --> to reset counter

edgeResetCounter(hetRAM1, edge1);  --> to reset counter

edgeGetCounter(hetRAM1, edge0); ---> to  get counter

edgeGetCounter(hetRAM1, edge1);------> to get counter

 

I used V3.6 to generate code, and replace the files of V3.8.1 one by one.

after replace "sys_selftest.h", "sys_core.h", "sys_pmu.h" and  "sysys_selftest.c"

The  edgeGetCounter(); always read "0".

My MCU is TMS570LS0432PZ.

  • Hi

    Sorry I do not have the TMS570LS0432PZ device to check, Attached is a simple Edge counter example using TMS570LS3137 device and HALCoGen 3.09.00. The use case is similar for TMS570LS0432PZ

    An external connection must be made between A5 pin and W3 pin for this to work. The GIOA[0] pin is toggled 100 times with a small delay between each toggle. The Input Capture unit's NHET1[6] pin takes it as input and counts the edges captured.

    1070.HetPwmTest.zip

  • Hi Prathap,

    Please enable ram parity, and try again.

    HET1 --> HET1 Global Timming Configuration --> Enable Ram Parity.

    I enable it in HALCoGne V.03.06.00, my counter is working.

    After I disable it in HALCoGen V03.09.00, my counter is working.

     

  • Hi Kenny,

    This is a sequencing issue, parity must be enabled before doing memcopy.. Please use USERCODE and Enable Parity before MEMCOPY routine like below. We will fix this in upcoming release planned for end of May.

    In 3.06.00 the parity was Enabled in the selftest.c even before doing hetInit(). Hence you did not see the issue. Where as 3.09.00 in selftest we revert back to original PCR value hence parity was disabled.

    /* USER CODE BEGIN (1) */
       /** - Parity control register
        *     - Enable/Disable Parity check
        */
        hetREG1->PCR = (uint32) 0x0000000AU;
    /* USER CODE END */