We detect you are using an unsupported browser. For the best experience, please visit the site using Chrome, Firefox, Safari, or Edge. X
Maximize Your Experience: Reap the Personalized Advantages by Completing Your Profile to Its Fullest. Update Here
Stay in the loop with the latest from Microchip. Update your profile while you are at it. Update Here
Complete your profile to access more resources. Update Here

AN585

Title
Title
A Real-Time Operating System for PIC16/17
Name
Name
AN585
Date
Date
06/24/2015
Product Categories
Product Categories
8-bit MCU
Description
Description
Ever dream of having a Real-Time Kernel for the PIC16CXXX family of microcontrollers? Or ever wonder what Multitasking or Threads are all about? Then this article is for you. We will explore how to implement all of the features of a large Real-Time Multitasking Kernel in much less space, with more control, and with-out the large overhead of existing kernels. By planning ahead, and using the techniques outlined here, you can build your own fast, light, powerful, flexible real-time kernel with just the features needed to get the job done. Included in this article are two large examples: one on the PIC16C54, and the other on the more powerful PIC16C64. A ?Remote Alarm? is implemented on the PIC16C54 as an example of a Non-Preemptive Kernel, with two asynchronous serial input sources capable of running up to 19,200 Baud along with seven sensors needing to be debounced as inputs. One more input line is monitored and causes an internal software recount. For output, this example has an LED that shows eight different internal states of the ?Remote Alarm?, blinking at different rates and different sequences. Last but not least, is an asynchronous serial output capable of running at 38,400 Baud, passing the inputs to the next remote alarm station. Several short and long timers are included to round out the nine cooperating tasks in this example. Please refer to Figure 2 and Appendix B. The second example is implemented on an PIC16C64 featuring an interrupt driven Semi-Preemptive Kernel. This example has the serial input and output routines of the first example moved into Interrupt Service Routines (ISR) for more speed and accuracy. The interrupt capabilities of the PIC16C64 will be explored, and a Real-Time Multitasking Kernel framework will be developed.

Files


Title
Title
Date
Size
AN585 Source Code - A Real-Time Operating System for PIC16/17 63.9 KB 09/24/2021 AN585 Source Code - A Real-Time Operating System for PIC16/17 09/24/2021 63.9 KB Download

Live Chat

Need Help?

Privacy Policy