Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

different execution time of xQueueSendFromISR

Posted 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 xQueueSendFro

Posted 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 xQueueSendFromISR

Posted 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 xQueueSendFro

Posted 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 xQueueSendFromISR

Posted 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 xQueueSendFro

Posted 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 xQueueSendFromISR

Posted 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


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Careers

FreeRTOS and other embedded software careers at AWS.


Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner