5.4. PIC16 C Operating Systems

• Polling

• Interrupts

• RTOS

As microcontroller operating programs become more complex, consideration must be given to the best method of organizing the program response to input, memory management, and output timing. Three main methods are used to handle input and output events, which after all, is the primary requirement of a real-time system. In order of complexity, they are I/O polling, interrupts, and the real-time operating system (RTOS).

Polled I/O

This is the easiest, and may be considered the default, method of input and output, where operations are simply scheduled as part of the main loop. It is seen in most of the examples in this book, because they have been deliberately kept simple. The basic principle ...

Get Programming 8-bit PIC Microcontrollers in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.