Quality RTOS & Embedded Software

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


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

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


FreeRTOS and other 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