Page 1 of 1

How do I use a timer in FreeRTOS for traffic?

Posted: Tue Mar 14, 2023 2:48 pm
by natee.th
I am a beginner looking for information on build what I interested and use FreeRTOS.
I would like to consult receive and send the timer task's data.

And would like to help guide me how to do it. I have watched several video tutorials.
But still not sure which way to do it, type A or B that is possible.

Image

Re: How do I use a timer in FreeRTOS for traffic?

Posted: Tue Mar 14, 2023 3:19 pm
by natee.th
Or C
Image

Re: How do I use a timer in FreeRTOS for traffic?

Posted: Tue Mar 14, 2023 5:59 pm
by Craige Hales
I'm not sure what those pictures mean. What are you trying to create?
I think you want to look at tasks, semaphores, and interrupt handlers.

Start simple: make a timer-driver interrupt handler that uses a semaphore to release a task that waits for the semaphore. Print a short message from the task each time it is release. Once you see how those three pieces work together, you'll get some ideas for bigger projects with several tasks and several interrupt handlers.

task: while true { wait for semaphore, print "hello" }
handler: signal the semaphore
main: start task, set up timer+handler