Hardware Timer

Discussions and support about ChibiOS/RT, the free embedded RTOS.
louis
Posts: 23
Joined: Tue May 17, 2016 9:26 am

Hardware Timer

Postby louis » Wed Jun 15, 2016 10:49 am

Hi,

I would like to use my PIT (used in my sequencer) in the ChibiOS/RT. But I don't see where the hardware timer is initialized. I only see virtual timer functions. Do you know where the hardware timer is initialized?
For information, I use a PowerPC SPC564A with CW.

Thank you for you help.

Louis

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Hardware Timer

Postby Giovanni » Wed Jun 15, 2016 12:16 pm

Hi,

Look in hal_lld.c (there is one for each device), it is part of the HAL provided by ST. PIT is initialized and used there.

Giovanni

louis
Posts: 23
Joined: Tue May 17, 2016 9:26 am

Re: Hardware Timer

Postby louis » Thu Jun 16, 2016 10:10 am

Thank you Giovani,

If I only want to change my sequencor by your scheduler of your RTOS with your clock, which files should I take?

Louis

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Hardware Timer

Postby Giovanni » Thu Jun 16, 2016 10:24 am

Sorry, I don't understand your question :(

Giovanni

louis
Posts: 23
Joined: Tue May 17, 2016 9:26 am

Re: Hardware Timer

Postby louis » Thu Jun 16, 2016 10:49 am

In our project, we didn't use a RTOS. So, we created a scheduler named task_manager. Now, we decided to use another scheduler (with a new clock) from a RTOS. We chose yours :D

The file which initalizes my clock is in the HAL component, and the scheduler is in ChibiOS/RT.
So my questions is : which files (of HAL and RT) should I keep and modify?

This is my subject of my internship :) . So, sorry to disturb you with novice questions :(

Louis

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Hardware Timer

Postby Giovanni » Thu Jun 16, 2016 11:22 am

The best way is to take an example ChibiOS project and then add your files to the Makefile. It is much easier this way.

If you want to integrate the RTOS in a different environment there would be many pitfalls.

Giovanni

louis
Posts: 23
Joined: Tue May 17, 2016 9:26 am

Re: Hardware Timer

Postby louis » Fri Jun 17, 2016 4:21 pm

Hi,

Thank you. I will do it. I already checked your test and there is one for my PowerPC (SPC564A80). But the compiler is not CW.
But if I take the test of SPC56EC (which uses CW) and I change/edit some files, it should work, isn't it?

Louis

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Hardware Timer

Postby Giovanni » Fri Jun 17, 2016 5:30 pm

Hi,

Only two demos have CW project files but all of them should work if you create the CW project correctly.

Giovanni


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 9 guests