How do I use a timer in FreeRTOS for traffic?

natee.th
Posts: 26
Joined: Fri Feb 10, 2023 5:25 pm

How do I use a timer in FreeRTOS for traffic?

Postby natee.th » Tue Mar 14, 2023 2:48 pm

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

natee.th
Posts: 26
Joined: Fri Feb 10, 2023 5:25 pm

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

Postby natee.th » Tue Mar 14, 2023 3:19 pm

Or C
Image

Craige Hales
Posts: 94
Joined: Tue Sep 07, 2021 12:07 pm

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

Postby Craige Hales » Tue Mar 14, 2023 5:59 pm

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
Craige

Who is online

Users browsing this forum: No registered users and 60 guests