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.

TMS570LS31HDK how to create continuous timeline

Other Parts Discussed in Thread: HALCOGEN

I need to implement a function that returns the time since poweron/reset/init in microseconds.

Later the client code will use this function as timebase to implement wait and simple measurement of time duration.

Code Composer 6.1
HAL Code Generator 04.05.1
TMS570 HDK Board

HET provides API edgeGetCounter : Get current edge counter value.
HET provides API hetGetTimestamp : Returns loop count based timestamp.

I did in HAL-Code Generator:
Driver Enable : Enable GIO Driver
Driver Enable : HET1 Driver
PINMUX Enable HET1
PINMUX Enable GIOA
Note: No RTI.

HET1: Loop Time 800 => Actual LR Time 800nsec
HET1: TAB Edge0-7: Edge0 change pin 12 => pin0
HET1: TAB Edge0-7: Edge1 change pin 13 => pin1
HET1: TAB Edge0-7: Edge2 change pin 13 => pin2

Expected:

Application Code (Init):

hetInit();
hetResetTimestamp (hetRAM1);
edgeResetCounter (hetRAM1, 0);
edgeResetCounter (hetRAM1, 1);
edgeResetCounter (hetRAM1, 2);
edgeResetCounter (hetRAM1, 3);
edgeResetCounter (hetRAM1, 4);
edgeResetCounter (hetRAM1, 5);

ts[0] = hetGetTimestamp(hetRAM1);
tse [0] = edgeGetCounter(hetRAM1, 0);
tse [1] = edgeGetCounter(hetRAM1, 1);
tse [2] = edgeGetCounter(hetRAM1, 2);
tse [3] = edgeGetCounter(hetRAM1, 3);
tse [4] = edgeGetCounter(hetRAM1, 4);
tse [5] = edgeGetCounter(hetRAM1, 5);
ts[1] = hetGetTimestamp(hetRAM1);

On target:
The value of timestamp increments more than 1.
The value of edge counter is zero .
The init hangs if SAFETY INIT checks (BIST) are selected.

Expected:
timestamp incremented every 800 nsec (loop value)
Edge: pin0 incremented every 12.5 nsec (80 Mhz Clock)
Edge: pin1 incremented every 25 nsec ()
Edge: pin2 incremented every 50 nsec ()

I am pretty new on TMS570. I do not know if my expectation is correct.
Please confirm.

If I have to write customized HET code then can you please explain why and how.

BTW: If I run with Debugger and stop, does HET increment counters or only executed if CPU runs ? 

Thanks,
Martin

  • Martin,


    My first question is why not using the RTI module as timebase for counting microsecond?

    The HET code in Halcogen is more like a template that provide basic timing functionality.
    If you need something really custom, you will have to write your own HET code.

    To help in this process, you can use the HET GUI to develop, compile and debug your HET application using the build in simulator.

    Once your code is functional, it can be imported in Halcogen. This custom code will replace the default Halcogen/HET code.

    In Halcogen, under HET1/HET2 Global Timing Configuration, there is a check box (checked by default) named: "Ignore Suspend"
    When it is checked, when the CPU is halted, the HET will continue to execute is code. Timer, PWM, Capture... will continue to work.
    If it is un-checked, than HET will be stopped and will resume when the CPU is running again.

    I will check and try to understand your code.

    Could you also specify which device you are using. Sharing your application will also help debugging your issue.

  • I do not use RTI because it adds additional dependencies. 

    It should be a easy task for a HighEnd Timer Module to produce and count microseconds. 

    Attached workspace_TIME.zip contains a simple project. 

    Please see subfolder workspace_TIME.zip\workspace_TIME\doc for some screenshots.

    3247.workspace_TIME.zip

  • Hello 

    I tried RTI based on rtiBlinky example i.e. count compare interrupts in a global variable. 

    I do not know why, but I do not get a notification. 

    Attached my project.

    Martin

    6011.workspace_TIME_rti.zip

  • Martin,

    Do you have any connection at board level on N2HET pin 0, 1, 2, 3?
  • Martin,


    In the Halcogen VIM setup the RTI Compare0 interrupt is enable but defined as FIQ. It should be IRQ.

    I know, the Halcogen example is showing the interrupt has FIQ.

    So once it is defined has IRQ, your will still do nothing.
    The bsp_get_time(); will execute within the 0.5ms period of RTI Compare0.

  • Hello

    > Do you have any connection at board level on N2HET pin 0, 1, 2, 3?

    I did not connect something on hardware and I did not configure something.
    It seems HET is too complicated for me.

    RTI works now.
    For completness attached the working example.
    The application counts compare counter0 notifications and turn
    on/off the onboard LEDs.

    The tri-color LED is set based on compare counter1 notification (different frequency).

    Thanks for your support!
    Martin

    8547.workspace_TIME_rti_functional.zip