BAR1 Source Code

The program source code (Listing B.2) starts with a comment block containing the name of the project, author, date, version, and program description. Details of the compiler version, development system, and target hardware can be included. In other words, as much information as possible to allow the code to be modified, updated, and maintained effectively. In CCS C, the initialization phase includes a header file that defines the MCU for which the program is intended. This is necessary as every PIC processor has a different set of features: the number of ports, memory size, special input and output facilities, and so on. The include statement is defined as a compiler (preprocessor) directive by the leading hash symbol (#). The ...

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.