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.

TDA4VL-Q1: Gptimer

Part Number: TDA4VL-Q1
Other Parts Discussed in Thread: J721EXCPXEVM, J721S2XSOMXEVM

Tool/software:

Dear TI,

I just set countVal in Gpt_StartTimer to 960000U, and the log will show that the interrupt function of channel 6 is always triggered. I am using sample code, and I think the log is abnormal. 

If I want to trigger the interrupt function every 20 ms, how should I do?

ps. sample code: ti-processor-sdk-rtos-j721s2-evm-10_01_00_04

pps. one shot mode is OK, only continuous mode has some problem.

Many thanks!!

Alice

  • Is any one there? I just want to know why modifying a parameter will change the logs a lot?

  • Hi Alice,

    What sample code are you referring to?

    I just set countVal in Gpt_StartTimer to 960000U, and the log will show that the interrupt function of channel 6 is always triggered. I am using sample code, and I think the log is abnormal. 

    What is abnormal? Is the period not as you expect?

    Thanks,

    Neehar

  • Dear Neehar,

    I am using "ti-processor-sdk-rtos-j721s2-evm-10_01_00_04\mcusw\mcal_drv\mcal\examples\Gpt\GptApp.c" as sample code.

    I think the period is the same as I expected, but I don't understand why GPT_CH_MODE_CONTINUOUS behaves differently after changing countval (it only triggered once when the period is longer, and it triggered repeatedly after the period is shortened 100 times (as shown in the log)). If I want to use a timer to control Can transmission (send message every 20 ms), will there be any impact?

    Thanks!!

    Alice

  • Hi Alice,

    Let me check and test with this example and I will get back to you after.

    Thanks,

    Neehar

  • Hi! Any updates?

  • Hi Alice,

    I am checking with the MCAL expert on this. I will follow up when I have an update.

    Thanks,

    Neehar

  • Hello, Alice,

    I am using "ti-processor-sdk-rtos-j721s2-evm-10_01_00_04\mcusw\mcal_drv\mcal\examples\Gpt\GptApp.c" as sample code.

    I think the period is the same as I expected, but I don't understand why GPT_CH_MODE_CONTINUOUS behaves differently after changing countval (it only triggered once when the period is longer, and it triggered repeatedly after the period is shortened 100 times (as shown in the log)). If I want to use a timer to control Can transmission (send message every 20 ms), will there be any impact?

    You are running the default example right?

    I just set countVal in Gpt_StartTimer to 960000U, and the log will show that the interrupt function of channel 6 is always triggered. I am using sample code, and I think the log is abnormal. 

    The value is calculated as below

    Value = <Clock Frequency in MHz> * <Required Time duration in seconds>

    The crystal frequency is 19.2 MHZ If you are using TI EVM it is not 25 MHZ

    You can calculate value by 19.2MHZ * 20 ms

    TLDR register should be loaded with FFFF FFFF - Value(in Hex)

    Regards
    Tarun Mukesh
  • Dear Tarun,

    1. Yes, I just downloaded the psdk and build the binaries, so I think I am running the default example right.

    2. I am not sure how to know the TLDR register is loaded with FFFF FFFF, but I think the default example is set to right value?

    3. This is another question I had asked. I have used the formula to calculate the period, but there is some unexpected error. So my question is mainly about Gpt&Can, not just period setting.

    link: TDA4VL-Q1: Can&Gptimer - Processors forum - Processors - TI E2E support forums

    Thanks!!

    Alice

  • Hello Alice,

    The default example is set for ~6 sec .But you changed the value.

    I just set countVal in Gpt_StartTimer to 960000U

    Are you using TI EVM or custom board ? As i said it changes with the crystal frequency.

    3. This is another question I had asked. I have used the formula to calculate the period, but there is some unexpected error. So my question is mainly about Gpt&Can, not just period setting.

    link: TDA4VL-Q1: Can&Gptimer - Processors forum - Processors - TI E2E support forums

    Let me check and reply in that thread.

    Regards

    Tarun Mukesh

  • Dear Tarun,

    1. No, I just reduced the default value by two zeros (reduced by 100 times), so is it not allowed that the value cannot be divided by 19.2 ? I thought it was just the time that was not so accurate(won't impact on other functionality)?

    2. I am using J721S2XSOMXEVM as CPU board and J721EXCPXEVM as common processor board. I think the clk is also 19.2 MHz?

    Thanks!!

    Alice

  • Hello Alice,

    . No, I just reduced the default value by two zeros (reduced by 100 times), so is it not allowed that the value cannot be divided by 19.2 ? I thought it was just the time that was not so accurate(won't impact on other functionality)?

    It should affect time only but not any functionality. If you change back to 96000000 is it working normally ?

    I ran the sample example at my end for channel 6

    GPT_APP------------------------------------------
    GPT_APP: GPT Channel 6 configuration register values  
    GPT_APP TIMER_TIDR         : 0x50003900
    GPT_APP TIMER_TTGR         : 0xffffffff
    GPT_APP TIMER_TSICR        : 0x0
    GPT_APP TIMER_TIOCP_CFG    : 0xa
    GPT_APP TIMER_TCLR         : 0x0
    ------------------------------------------
    GPT_APP: Running GPT Test for channel 6
    ------------------------------------------
    GPT_APP: Enabled notification for channel [6]
    GPT_APP: Started Timer Channel [6]
    GPT_APP: Elapsed Time Value = adaf4
    GPT_APP: Wait for notification(approx. 6 seconds)
    GPT_APP: GPT Notification received for channel 6 !!!
    
    GPT_APP: Disable channel notification for this channel
    GPT_APP: Wait till timer overflows, no notification should be received
    GPT_APP: Time Elapsed Value = 0x36dc6e
    GPT_APP: Time Remaining Value = 0x575f3e8
    GPT_APP: Waiting for timer to overflow
    GPT_APP: Overflow happened no notification received
    
    GPT_APP: Stopped for channel 6
    GPT_APP: Enable wakeup for this channel
    GPT_APP: Started timer channel [6]
    GPT_APP: check if this channel is wakeup source for any wakeup event
     EcuM : Wakeup event received for wakeupSource =2 !!!
    GPT_APP: Woken up for channel [6]
    GPT_APP: Stop timer 
    GPT_APP: GPT example passed for channel =6 !!!

    There is no issue.

    Regards

    Tarun Mukesh

  • Alice,

    By default Channel 6 is in  continuous mode only run the example of GPT and you can understand by i think you did some changes in the application that is causing some issue at your end,

    Regards

    Tarun Mukesh

  • Dear Tarun,

    I think I know why changing the value makes them behaves differently.

    1. When set to 4.77s(96000000), it will stop timer before next interrupt.

    2. When set to 0.048s(960000), the thread can't switch timely between main and timer, so it will trigger repeatedly.

    Am I right?

    Thanks!!

    Alice

  • Hello Alice,

    There are delays written in the example application for 1sec .

    AppUtils_delay(1000U);
     
    When set to 0.048s(960000), the thread can't switch timely between main and timer, so it will trigger repeatedly.

    I suspect kind of same since application is written for 6 sec. For your time it is not able to disable the notification and further proceed.

    RegardS

    Tarun Mukesh