I was working on PIC24fJ128GA202 microcontroller for 2 months, Since my application getting more complicated i decided to program on multitasking in pic microcontroller it is much complicated to do multitasking without RTOS . I am using XC16 compiler and Maplab 8.92 v . Can anyone suggest me how to start working in RTOS for 16 bit Microcontroller using XC 16 compiler?. I google it, but i dont get any clear idea and also i found some code GITHUB.com.
You can just download it and try it: http://www.freertos.org/portpic24_dspic.html
because RTOS has a huge source code
Huge is a relative term - if, without using the RTOS, you have to structure your code as a set of state machines, and explicitly include lots of timing information in your code, and changing to use an RTOS means the structure of your code become much simpler, and the timing is instead managed by the RTOS, then the difference in code size with and without FreeRTOS might not be much different.
because you are adding unnecessary overhead on your microcontroller
This misconception is deeply rooted in the embedded industry. Without an RTOS you might have to poll interfaces continuously, or look for state changes in a state machine continuously - both a waste of valuable CPU time. With an RTOS you can structure you code to be 100% event driven, with the CPU in sleep mode most of the time, and therefore only use CPU time when there is actually productive processing to perform. That is not adding an overhead, it is removing an overhead.
....but I agree, you should use the most optimal design choice for your individual application, and only people who have knowledge of the system requirements can make the decision as to whether it is better with or without an RTOS.
Try OpenRTOS by Wittenstein, which is ported for a PIC24. Essentially, a version of freeRTOS with added support.
I agree with CZAbhinav, use it only if you have to because you are adding unnecessary overhead on your microcontroller. Most versions of freeRTOS use a 1ms timer (very slow) and do not guarantee realtime operation.
Unless you are designing your system for human interaction, like button presses etc... where it is not so time critical then yeah use a RTOS. Anything else you are probably better off re-optimizing your code to make it simpler.