Skip to Content
Programming 8-bit PIC Microcontrollers in C
book

Programming 8-bit PIC Microcontrollers in C

by Martin P. Bates
August 2008
Beginner to intermediate
304 pages
6h 2m
English
Newnes
Content preview from Programming 8-bit PIC Microcontrollers in C

2.5. PIC16 C Functions and Structure

• Program structure

• Functions, arguments

• Global and local variables

The structure of a C program is created using functions (Figure 2.11). This is a block of code written and executed as a self-contained process, receiving the required parameters (data to be processed) from the calling function and returning results to it. Main()is the primary function in all C programs, within which the rest of the program is constructed.

Figure 2.11. Hierarchical C Program Structure

When running on a PC, main() is called by the operating system, and control is returned to the OS when the C program is terminated. In the microcontroller, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming 16-Bit PIC Microcontrollers in C, 2nd Edition

Programming 16-Bit PIC Microcontrollers in C, 2nd Edition

Lucio Di Jasio

Publisher Resources

ISBN: 9780750689601