Motivation at the moment is just interest / curiosity and the thought that my current home project would be a good system on which to try such a framework. The project uses a small 14 bit PIC (4K words prog mem, 192 bytes RAM) largely because I have a couple in the spares box and thought I should start using up all these old components before they (and me) reach their sell by date.
With 4k words program memory and particularly with 192 precious bytes of RAM, you are going to need a very lean event-driven real time framework in order to have sufficient resources left for even a modest application.
RTOS's are configurable so you can limit the memory footprint, but even so you are pretty unlikely to find an RTOS that can even run in 192 bytes of RAM much less leave you enough RAM for an application.
The ubiquitous FreeRTOS shows PIC as one of the available platforms. What you find though is that there is a port for the PIC18F452 which at a minimum has 8192 words of program memory and 768 bytes of RAM.
The situation is similar with Micrium's uC/OS-II or -III. They offer a free maker's license these days and there is a PIC port available, but is is for the PIC24FJ128GA which has more memory resources than the PIC18F452. Here Micrium notes that they require 6k bytes of ROM minimum and 1k+ bytes of RAM.
QL-nano may be your only option, and I believe you'll have to have to do your own port to your 14-bit PIC device. They mention QL-nano running on an 8051 with 256 bytes of RAM. I have no experience with QL-nano, but if I understand correctly you'll be describing your application to the tools as a set of hierarchical state machines as opposed to the more conventional RTOS model where you define tasks and communication in C or C++.
I fully support what you want to do, but if your objective is to test the waters in a real time event driven development environment, you might consider an inexpensive development board based on a 32-bit ARM processor with a readily available port of an RTOS that looks interesting to you.
From your description, you seem to be mostly interested in very small systems. To this end, the QP-nano framework runs on PIC24/dsPIC, MSP430, and AVR (as well as other CPUs, such as Cortex-M0/M0+). QP-nano used to run on PIC18, but the support has been dropped, because the 8-bit PIC family does not really support any standard-compliant C language implementation.
For this small of a micro, personally I would just do a command loop with interrupt-driven devices.
I don't know the "frameworks" the other posters have suggested.
It really depends on your goal:
- learn RTOS principles
- use up your little PICs
- learn howto shoehorn an OS into a small PIC
If learning an RTOS, I personally would go with am ATXMEGA ($20 from Amazon) and use the FreeRTOS port. That way you have something working that you can play with.
If you want to use up your PICs, I would go the command loop && interrupt devices. You would still learn a lot
The last is the most difficult. You *would* learn a lot, at the cost of much frustration. The other suggestions by the other posters sound like that is the path with the best chance of success.
However, I never stand in the way of someone doing something that looks insane (as long as they leave others alone). If you go with door #3, you have a high probability of failure, but this is not going to melt down a nuclear reactor. (You might end up bald...) This kind of failure is very useful, and if you succeed - wow!