CCS at www.ccsinfo.com makes a C compiler for the rest of us that costs between $99 and $350 depending on which version you buy - I have the $99 one for DOS and Mid Range PIC chips - called CCS-PCM. It is meant to ease the programmer's task in preparing code for the Microchip PIC Microcontroller (Visit Microchip Website For More Information about the PIC).
Starting out with the C compiler may not be as clear as it could be - especially if you are new to PIC programming. While there are several sites that have PIC code and have great resources, the examples shown on the sites usually depend on a particular kind of evaluation board or piece of hardware. This page expects very little formal hardware. You should be able to breadboard up a PIC and get it kicking over. That's about it.
First off - there is no substitute for understanding the PIC before you start programming. I highly recommend you get Easy Pic'n by Benson (ISBN 0-9654162-0-8) from Dontronics or HVW Technology or Amazon or somewhere similar. Go through the book and teach yourself assembler. The software to do it is free from Microchip. It will only take you a couple of days to get through the book (or less if you want to pull an all-nighter).
The rest of this page assumes you know a little about PIC architecture, have installed CCS on your computer, and are just wondering what to do next.
Benson's Easy Pic 'n has some great (and simple) .asm examples in it and I decided to convert some of the ideas to C code. The following are those conversions. All the examples depend on you having a 16F84 PIC that you have figured out how to load with .hex code from the C compiler using a programmer. There are tons of programmers out there - I use one from Peter Anderson's Site and I have recently acquired a PICSTART Plus (available from Digikey and elsewhere).
2. PIC (16F84) from Digikey, Dontronics, Peter Anderson, etc
3. Two 8 switch DIP switches (I pulled mine from a couple of old modem boards but they are also available from Radio Shack and elsewhere).
4. Several SPST switches - either push button or toggle.
5. Several LEDs (or better yet, an 8 LED bar from Radio Shack)
6. A 7 segment display for one of the programs (also available from the Shack).
7. A 5 volt power supply for the breadboard (7805 setup of some sort).
9. 74HCT04 chip for a bounceless (sort of) half monostable multivibrator. See the Easy Pic 'n book for hookup.
10. A wall wart power supply.
Did you try the code and it wouldn't compile? READ THIS:
LOOKING AT C CODE ON A WEB BROWSER SUCKS. DOWNLOAD THE ZIP FILE AND LOOK AT IT in notepad or a proper editor. If you click on the links, some code will be hidden. Be sure to download and install the first file as defs_f84.h