17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXAMPLE PROGRAMS<br />

EXAMPLE PROGRAMS<br />

A large number of example programs are included with the software. The following is a list of<br />

many of the programs and some of the key programs are re-printed on the following pages.<br />

Most programs will work with any chip by just changing the #INCLUDE line that includes the<br />

device information. All of the following programs have wiring instructions at the beginning of the<br />

code in a comment header. The SIOW.EXE program included in the program directory may be<br />

used to demonstrate the example programs. This program will use a PC COM port to<br />

communicate with the target.<br />

Generic header files are included for the standard PIC® parts. These files are in the DEVICES<br />

directory. The pins of the chip are defined in these files in the form PIN_B2. It is recommended<br />

that for a given project, the file is copied to a project header file and the PIN_xx defines be<br />

changed to match the actual hardware. For example; LCDRW (matching the mnemonic on the<br />

schematic). Use the generic include files by placing the following in your main .C file:<br />

#include <br />

LIST OF COMPLETE EXAMPLE PROGRAMS (in the EXAMPLES directory)<br />

EX_14KAD.C<br />

An analog to digital program with calibration for the PIC14000<br />

EX_1920.C<br />

Uses a Dallas DS1920 button to read temperature<br />

EX_8PIN.C<br />

Demonstrates the use of 8 pin PICs with their special I/O requirements<br />

EX_92LCD.C<br />

Uses a PIC16C92x chip to directly drive LCD glass<br />

EX_AD12.C<br />

Shows how to use an external 12 bit A/D converter<br />

EX_ADMM.C<br />

A/D Conversion example showing min and max analog readings<br />

EX_ADMM10.C<br />

Similar to ex_admm.c, but this uses 10bit A/D readings.<br />

EX_ADMM_STATS.C<br />

Similar to ex_admm.c, but this uses also calculates the mean and standard deviation.<br />

EX_BOOTLOAD.C<br />

371

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!