Baseline PIC C Programming Tutorials

The following tutorials build on the material covered in the baseline assembler tutorial series, showing how to implement the example applications from those lessons, using freely available PIC C compilers from Microchip (XC8) and CCS.

To get the most out of these lessons, you should purchase the Gooligum baseline training and development board, which was designed to complement this tutorial series.

Search this site:
Custom Search


Download all the baseline C lessons as a single zip file from the Gooligum Electronics shop

or access them individually:

Click on the lesson title to read each tutorial (PDF).
Right-click the source code links to save the code for that tutorial to your PC.

1: Basic Digital Output
Introducing XC8 and CCS PCB
Simple control of digital output pins on baseline PICs
Updated 29/8/12
L1 source
2: Reading Switches
Reading and debouncing simple switches and using internal pull-ups
Updated 4/8/12
L2 source
3: Using Timer0
Configuring and accessing Timer0
Using Timer0 for event timing, background tasks, debouncing switches, and counting
(with some examples of C macros)
Updated 24/9/13
L3 source
4: Sleep Mode and the Watchdog Timer
Using sleep mode, wakeup on change, and the watchdog timer
on baseline PICs
Updated 8/8/12
L4 source
5: Driving 7-Segment Displays
Single and multiple 7-segment displays, lookup tables and multiplexing
on baseline PICs (using the PIC16F506)
Updated 8/8/12
L5 source
6: Analog Comparators
Comparators, fixed and programmable voltage references
Updated 9/8/12
L6 source
7: Analog-to-Digital Conversion and Simple Filtering
Analog-to-digital conversion (ADC) and calculating a moving average
(accessing banked memory)
Updated 10/8/12
L7 source

PDF files are read with free Adobe Reader software. Click here to get adobe reader

Return to Main Page