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.

TMS320F28379D: Single display for counter timer 2

Part Number: TMS320F28379D


Hello, 

I desire to utilize the single time display for showcasing the timer2 value, but I encounter an unusual behavior when the timer is deactivated.

The single disply continue to show me a variation but timer is not counting?

Do you have any idea please?

Thank you in advance,

S.Tarik

  • Hello,

    Can you please indicate what you are seeing when you say the counter is still counting? I see you have set the TSS bit to stop the counter, but it's not clear to me what it varied from after the TSS bit was set (please show a before and after screenshot if possible relative to the TSS bit being set). I tested this on my side by using the CPUTimer_stopTimer driverlib function and it worked fine (this driverlib function clears any overflows and sets the TSS bit).

    Best regards,

    Omer Amir

  • Can you please indicate what you are seeing when you say the counter is still counting?

    You could see that the timer is halted by setting TSS to 1 but the graph still has up and downs as if the counter is counting.

    the address of the graph is the timer2 counter. the strange thing is that even if the counter timer is stopped the graph continues counting. I could not also understand the max of the graph and the maximum value when I reload the timer. the register shows 0x800 but the single graph max peak is 16000. 

    I am trying to display the timer counter on the graph. but something happened when I stoped it I could no see the same behavior on the graph.

    hope that I clarified the issue.

  • Hello,

    I have already tested on my side, I don't see any problem like this. In debug mode ca you try to pause at an instance where the timer is still counting and/or exceeding the period that you set (you can use conditionals or step through your code)? It looks like you're changing the timer settings after the timer is stopped, so I'm not sure if you're preserving the values already in those registers, and if these registers are modified anywhere else.

    Best regards,

    Omer Amir

  • Hello Omer,

    I think the issue is du to the buffer data, I conduct a test on a TI exemple and I remarked the same behavior,
    The buffer used by single timer of 50 doesn't update his contente and still print the same result when the timer is stopped. It's confusing because the buffer is not flashed or refreshed with the new values of the timer when we reset TSS.

    TSS=1

    befor TSS =0

    Do you have any idea how resolve this issue? it looks like I have to activate somthing but not sur.

    one more thing, i am using CCS  Version: 9.3.0.00012 

  • Hello,

    I tried this on my own LaunchPAD with the following graph properties:

    I changed the buffer to 1 and changed the sampling rate to 50 kHz (your rate of 1 Hz meant it was refreshing the graph with data once every second). The counter in the example I used had a period of 1 second, so the period was 200 million which can be seen in the below graph.

    My counter stopped just fine (the flat top parts), when I called the stop timer function while other timers I had were running. Try these graph settings and let me know if you're still seeing an issue.

    Best regards,

    Omer Amir

  • Omer,

    Thank you for your help,

    Yes I have somthing similar, the important thing is when I stop the timer the graph shows the timer value, I have to make some adjustements to make the graphe readable enough.

    so why we have by defaut 50 in the size of the buffer? Why when we change to 2 for example, it doesn't show what we expected?

    If I understand the refreshing frequency does not have any relation with the timer frequency?

    Thank you in advance 

    S.Tarik

  • Hello Tarik,

    If I understand the refreshing frequency does not have any relation with the timer frequency?

    That is correct, the sampling rate for the graph just tells the graph how often it should pull a new value.

    so why we have by defaut 50 in the size of the buffer? Why when we change to 2 for example, it doesn't show what we expected?

    I'm not sure why this default value is chosen, or how exactly the buffer works in the graphing tool. I will loop in a compiler expert to better answer this.

    Best regards,

    Omer Amir

  • I'm not sure why this default value is chosen, or how exactly the buffer works in the graphing tool.

    The default value of 50 is arbitrary. As for how the buffer works, please see:

    https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-graphs.html#acquisition-buffer-size

    Thanks

    ki