To investigate various kinds of applications and to demonstrate techniques discovered and employed, a collection of examples has been provided:
Each example provides the following resources:
The devconfig.h file is intended to provide configuration settings related to the device configuration and oscillator (clock) frequency. The following definitions are employed:
The Makefile is concerned with defining source and program (target) files, build artefacts, configuration flags, employing the common definitions and rules found in the mk directory located at the top level of the CommonPIC32 distribution.
The main.c and main.h files are concerned with providing a main function with the following signature:
Since the mk/common.mk definitions file used by the build configuration provides access to various library files, the first tasks performed by the main function are likely to involve initialisation using various init_-prefixed functions.
Other necessary functions are those handling exceptions and interrupts, having the following signatures:
void exception_handler(void); void interrupt_handler(void);
These functions are called by the low-level library functionality when CPU exceptions and interrupts occur.