different execution time of xQueueSendFromISR

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

different execution time of xQueueSendFromISR

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.

different execution time of xQueueSendFromISR

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

different execution time of xQueueSendFromISR

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.

different execution time of xQueueSendFromISR

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

different execution time of xQueueSendFromISR

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.

different execution time of xQueueSendFromISR

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