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


Task execution point, synchronization and resource sharing

Posted by shan-ahmed on October 27, 2015

Well Im more like at early stage than a beginner to free RTOS.. & out from no where and without any kinda of helping material I hv got an assignment from my tutor to perform the following.

The complete scenario is as follows: Microcontroller to be used: PIC 18F452. Software Development IDE : MPLAB from Microchip Hardware Software Simulator: Proteus Simulator Compiler: Microchip C18 Lite Compiler RTOS: FreeRTOS

Application Description is as follows: A task called mytask1 is receiving data from the PORTA through port change interrupt using credit tracking synchronization and sends average of last four samples to mytask2. mytask2 will receive this sample and send it to PORTB which has LEDs connected to it. There are other three tasks namely mytask3, mytask4 and maytask5 which need mutually exclusive access to PORTD. The function of mytask3 is to send 0x00 to PORTD every 100 mili-seconds, mytask4 is to send 0x0F to PORTD every 500 mili seconds and my_task5 is to send 0xFF every 1000 mili seconds. During implementation use timing services provided by the RTOS whenever applicable and don’t use your own delay routines.

Seriously I dont want you people to do it for me, but I dont know anytthing about it, I just want you people me drive me through.. I will be very grateful.. :-)

Task execution point, synchronization and resource sharing

Posted by rtel on October 28, 2015

Sorry for the delay in replying, it appears several emails have got stuck in moderation over the last few days, even though the forum is set to automatically approve all posts from users who have logged in.

Note that the PIC18 is not a good target for a pre-emptive RTOS and has not been maintained in a long time.

The tasks that are writing to port D periodically could use software timers http://www.freertos.org/RTOS-software-timer.html and simple critical sections for mutual exclusion (taskENTERCRITICAL() before accessing the port, then taskEXITCRITICAL() after accessing the port).

A direct to task notification with the eSetValueWithOverwite action would be a quick way of sending a value from an interrupt to a task http://www.freertos.org/xTaskNotifyFromISR.html

[ 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