Timer application for TC275B controller

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I am very new to the Tricore micro controller. Also, I have an intermdiate knowledge in micocontroller programming. I have to measure the process time of the set of code in tricore(core0) The code was generated externally by another software. Therefore, I need to implement a timer in the tricore. Could anyone help me to find a simple C code example program for the implementation of timer in TC27x microcontroller. I tried with TimeDemo example available in Infineon free entry toolchain. But it has some Problem due to its interrupts.The Controller process interrupted and halted while tried to run the program. It was hard to me identify the where the exact Problem. Therefore, I want to implement a simple time to measure the execution time only. Please help me to find the solution.

Thank you.


With best regards,
Jegan
0 Likes
5 Replies
User9888
Level 3
Level 3
jegan wrote:
Hi,

I am very new to the Tricore micro controller. Also, I have an intermdiate knowledge in micocontroller programming. I have to measure the process time of the set of code in tricore(core0) The code was generated externally by another software. Therefore, I need to implement a timer in the tricore. Could anyone help me to find a simple C code example program for the implementation of timer in TC27x microcontroller. I tried with TimeDemo example available in Infineon free entry toolchain. But it has some Problem due to its interrupts.The Controller process interrupted and halted while tried to run the program. It was hard to me identify the where the exact Problem. Therefore, I want to implement a simple time to measure the execution time only. Please help me to find the solution.

Thank you.


With best regards,
Jegan


Hi Jegan,

Does this one help maybe:

https://www.infineonforums.com/archive/index.php/t-3415.html

Best regards,

Henk-Piet Glas
Technical Product Specialist
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
TASKING.hp.glas wrote:
Hi Jegan,

Does this one help maybe:

https://www.infineonforums.com/archive/index.php/t-3415.html

Best regards,

Henk-Piet Glas
Technical Product Specialist



Dear Mr.Piet Glas,

Thank you for your reply. I tried with the following sample program mentioned in that link.

#include
#include

#include "sieve.h"

int main(void)
{
unsigned long dt, t = clock_msec();
StartOS(ERATOSTHENES); /* sieve primes using TASKING RTOS */
dt = clock_msec() - t;
printf("ms = %lu\n",dt);
return 0;
}


I got the error "No such file or Directory" for the headder files clock.h and sieve.h. Are they standard library files? Please see the attached files for further reference.


I look forwad your Kind Response.

Thank you.


with best regads,
Jegan
0 Likes
User9888
Level 3
Level 3
jegan wrote:
Dear Mr.Piet Glas,

Thank you for your reply. I tried with the following sample program mentioned in that link.

#include
#include

#include "sieve.h"

int main(void)
{
unsigned long dt, t = clock_msec();
StartOS(ERATOSTHENES); /* sieve primes using TASKING RTOS */
dt = clock_msec() - t;
printf("ms = %lu\n",dt);
return 0;
}


I got the error "No such file or Directory" for the headder files clock.h and sieve.h. Are they standard library files? Please see the attached files for further reference.


I look forwad your Kind Response.

Thank you.


with best regads,
Jegan


Hi Jegan,

I'm sorry, I should've read your initial posting with more care. When you wrote free entry tools I assumed the TriCore Lite tools. The implementation of clock.h is closely tied to the hardware and the toolset you use, and it may actually not work on another toolset. You'll have to consult your manuals to see if clock.h exists in your toolchain. If may for example be stored in rather than the that I used.

Best regards,

Henk-Piet Glas
Technical Product Specialist
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
TASKING.hp.glas wrote:
Hi Jegan,

I'm sorry, I should've read your initial posting with more care. When you wrote free entry tools I assumed the TriCore Lite tools. The implementation of clock.h is closely tied to the hardware and the toolset you use, and it may actually not work on another toolset. You'll have to consult your manuals to see if clock.h exists in your toolchain. If may for example be stored in rather than the that I used.

Best regards,

Henk-Piet Glas
Technical Product Specialist


Dear Mr. Piet Glas,

I searched in the whole C:\HIGHTEC insallation Folder. There is no Header file with the name clock.h. Toolchain has only timer.h and timer.c. Please see the Attachement.

Any other idea to include such a Header file to have simple timer program?

Thank you.


With best regards,
Jegan
0 Likes
User9888
Level 3
Level 3
jegan wrote:
Dear Mr. Piet Glas,

I searched in the whole C:\HIGHTEC insallation Folder. There is no Header file with the name clock.h. Toolchain has only timer.h and timer.c. Please see the Attachement.

Any other idea to include such a Header file to have simple timer program?

Thank you.


With best regards,
Jegan


Hi Jegan,

You might try and see if you can develop something using the CCNT special function register. You can use this article as a starting point:

https://www.infineonforums.com/archive/index.php/t-3403.html

Best regards,

Henk-Piet Glas
Technical Product Specialist
0 Likes