FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2009 Threads] different execution time of xQueueSendFromISRPosted by Tonau on August 3, 2009 Hi,
I use an interrupt function to received chars from the USART and put the received char into a queue. Therefore I use the xQueueSendFromISR function. Now I toggle a pin befor the function starts and toggle the same pin when the function ends. I use a logicananlyzer to measure the time, the xQueueSendFromISR function needs. I get times between 5 an 17 µs. Can anyone explain me why there are different durations, despite the same amount of data is put into the queue? Is it possible to shorten this time, because the rest of the interrupt only needs 2,5µs and the interrupttime directly influences my systems performance.
Thanks a lot, Tobias
RE: different execution time of xQueueSendFroPosted by Dave on August 3, 2009 Looking at the function I see there are different paths that can be taken, so I guess that is the answer to your question. The longest path is when writing to the queue causes a task to unblock.
RE: different execution time of xQueueSendFromISRPosted by Tonau on August 3, 2009 Hi, every new element in the queue unblocks the task with the highest priority in my programm. Is it possible to get a constant execution time of xQueueSendFromISR. Is there a possibility to get out the data from the USART in a faster way that also unblocks the task?
Tobias
RE: different execution time of xQueueSendFroPosted by Dave on August 3, 2009 Normally you would use a dma, fifo and / or a circular buffer to receive the characters in the interrupt then use a semaphore to unblock a task when a complete message was buffered.
RE: different execution time of xQueueSendFromISRPosted by Tonau on August 4, 2009 Hi, I give every byte I receive a timestamp of 6 Byte. One message contains only this byte plus the timestamp. So the message is complete and the task can process the data. But if I give the semaphore or put the data into a queue shouldn't make that difference in time. Anyway thanks for your answers.
Tobias
RE: different execution time of xQueueSendFroPosted by Dave on August 4, 2009 What I said was it would make a difference in time if it unblocks a task. Any time it takes a different path in the code it will make a difference in time.
RE: different execution time of xQueueSendFromISRPosted by Tonau on August 4, 2009 Hi, I give every byte I receive a timestamp of 6 Byte. One message contains only this byte plus the timestamp. So the message is complete and the task can process the data. But if I give the semaphore or put the data into a queue shouldn't make that difference in time. Anyway thanks for your answers.
Tobias
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|