Luis Alvarez
2010-04-01 08:23:01 UTC
Hi!
For a specific application I need to set a 50ms timer. With this, every
time 50ms elapsed I will count a Tic.
This 50ms tics are going to keep all the activity synchronized. For example
an execution of a given function is going to be set each 20 Tics.
I have tried some functions to do this but they are not accurate enough. I
need my tic count exactly each 50ms. What I know is I can use the hardware
timer interruption that takes place every 1ms. I would like to use that
interruption on my application.
The problem is I do not know yet how to do it. I know there is an ISR
handling that interruption and this is supposed to set an event to a IST.
Well, instead I want to set event that I can use in one of the threads of my
system. This way my thread will work exactly every 1ms and increase the Tic
count every 50ms.
Anyway, I have not been able to use that interruption. I do not even know if
it is possible.
Can somebody tell me if the way I want to implement an accurate 50ms tic
count is correct?
If it is not correct, Does anybody have an idea of how implement such a thing?
If it is correct, How do I use the hardware timer interruption on my
application?
For a specific application I need to set a 50ms timer. With this, every
time 50ms elapsed I will count a Tic.
This 50ms tics are going to keep all the activity synchronized. For example
an execution of a given function is going to be set each 20 Tics.
I have tried some functions to do this but they are not accurate enough. I
need my tic count exactly each 50ms. What I know is I can use the hardware
timer interruption that takes place every 1ms. I would like to use that
interruption on my application.
The problem is I do not know yet how to do it. I know there is an ISR
handling that interruption and this is supposed to set an event to a IST.
Well, instead I want to set event that I can use in one of the threads of my
system. This way my thread will work exactly every 1ms and increase the Tic
count every 50ms.
Anyway, I have not been able to use that interruption. I do not even know if
it is possible.
Can somebody tell me if the way I want to implement an accurate 50ms tic
count is correct?
If it is not correct, Does anybody have an idea of how implement such a thing?
If it is correct, How do I use the hardware timer interruption on my
application?