Using RTOS with PIC18

Status
Not open for further replies.

Lourens

Member
I use assembler with PIC18 processors for my applications together with a home-brewed RTOS (more of a cooperative task executive). There are no bells and whistles but it has served me well (or so I think) in some fairly involved control applications where some tasks require execution at predefined rates - say 20 to 200mSec. How about you guys - do you use an RTOS and what is your experience.

Lourens
 
For 99% of PIC18 programming tasks a RTOS is unnecessary overhead. If you have a project that 'needs' a OS to manage resources instead of using the PIC18 with properly structured direct embedded programming with high/low interrupts then you need a more capable chip for your project and RTOS.
 
nsaspook - i dont agree with your 99%. Some use an RTOS for the sake of the structure/order it brings even to a small application. My applications are mostly controlling things where timing is important. The following is a general example of tasks and services required.
- Read keyboard and drive led's and lcd display
- Logic to edit and save setpoint to eeprom
- Logic to edit and save alarm values
- Talk to rtc via i2c
- Logic to handle alarm indications
- Read temperature and filter it
- PID management logic
- PID controller
- PWM driver for thyristor
- uart handler for monitor and control via pc (38400 Baud)

Bill - seems like we are on the same wavelength. The following are a few details about my task scheduler system which you can see is at basic similar to yours:
- PIC clock speed 32Mhz (using PLL)
- 8 round robin tasks (task switch takes 2.25uSec)
- 7 Time activated tasks (select from 10,20,40,50,100,200mSec)
- A scheduler routine (2.25uSec) runs every 10mSec to control time tasks
- The program memory required is less than 100 bytes and up to 30 bytes ram
 

You don't have a RTOS and you don't for a very good reason(it's not needed). What you have is a auto task scheduler that almost every complex threaded PIC programs has at some point. IMO at the code complexity of a PIC18 project, source code level modularization is the proper method to use for structure/order instead abstracting the hardware with a RTOS.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…