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

how fast can a task response to a Que on PIC32?

Posted by shalongbasi on May 4, 2015

I am totally new to Freertos and now writing codes on PIC32MX795F512 running on 80MHz. In my code, A timer triggers an interrupt every 10us and timer ISR writes a dummy data to SPI to read an ADC chip. SPI Rx interrupt is then triggered after data ready and write the ADC data to a Queue. Another task will receive the data from the Queue.

With the help of the oscilloscope, I found that SPI writing is finished in 1.6us, and Que writing is started after 2us after SPI writing finish. Que writing takes about 1.8us. All these added together costs about 5.6us. I having another signal toggling to monitor the begin and end of queue reading, but it is not a stable waveform, looks like switching to Queue Receiving task and reading the queque cannot be finished in the rest 4.4us.

Anyone have the idea about how long normally tasking switching takes under 80MHz PIC32? I want to estimate if it is feasible to finish my application with Freertos. After this, I need to add another 4 channel SPI readings at 10K speed. Maybe it is not a good idea to use Freertos with my application. thanks.


how fast can a task response to a Que on PIC32?

Posted by edwards3 on May 6, 2015

How long does? Sounds like you answered your own question. Sounds like you are doing it the slowest way though, do you need the queue? If the isr is writing and the task is reading and the variable is 32-bits then the task can read it directly with no worry about data consistency. Write the data to a variable then use a task notification to tell the task. Its much faster than a queue. Or send the ADC result to the task directly as the value along with the notification, again must faster. Finally just have the interrupt write the data to a RAM buffer (circular probably). If there is too much disturbance in timing then use a interrupt priority above configMAXSYSCALLINTERRUPT_PRIORITY, but then you cant use the FreeRTOS API. I would not plan to switch tasks at that speed though.


[ 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