2.1. PIC16 C Getting Started

• Simple program and test circuit

• Variables, looping, and decisions

• SIREN program

Programming PIC microcontrollers in C is introduced here using the simplest possible programs, assuming that the reader has no previous experience of the language. The CCS compiler uses ANSI standard syntax and structures. However, a compiler for any given microcontroller uses its own variations for processor-specific operations, particularly input and output processes. These are fundamental to MCU programs and so will be introduced from the start.

Simple Program

Microcontroller programs contain three main features:

• Sequences of instructions

• Conditional repetition of sequences

• Selection of alternative sequences

The following basic ...

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.