Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists