C2C
C-compiler Examples

SourceBoost IDE is
probably the most feature-rich IDE among others that exist for
PIC today. We are open for business contacts with other
companies to integrate their tools (not only PIC related) like
tool chains, compilers, debuggers, simulators etc. into
SourceBoost IDE. If you are interested in this kind of
business relations please send a mail to [email-masked]

I am looking for a new day
time job. I work on SourceBoost IDE and compilers in my free time as
hobby but still go to regular job. If you visit my web pages you
probably have a good idea what I can do. Please contact me if your company has
a position. I live in SF Bay area.

Look how others write code.

Download an example.

Here is a more complicated example
that tests *./ and % operations.
This example
shows how to use interrupts.
Flash read/write is presented in
the flash.txt
example. And the flashtst.txt
example tests the flash.
The iter example
shows how to use iterrations.

Sample code that
shows how to interface PIC16F84 to RF module (with circuit)
(by http://www.picant.com/c2c/www.ant.org):

x10rf.c

x10rf.h

Simple, yet
flexible, mobile robot
platform which incorporated various sensor technologies and
programmable microcontroller devices (by James Gaston).

Serial port
funtions to allow non-blocking read and write (hardware UART).
Useful for debugging without changing all the timing, and for
general use of serial port. (by Jonathan Bisson):

SerialCom.c

SerialCom.h

test232.c

test232.h

Example code for 16F819(8xx) (with circuit
and board
pictures) which measures temperature via SMT160-30, shows it on LCD
and communicates with RS232 (sends values of temperature to
terminal) (by Petr Mervart):

display.c

display.h

rs232.c

rs232.h

smt160.c

temp_main.c

This project (with circuit)
created with ISD2560 record and playback chip, DS1821 temperature
sensor, PIC16F84 with circuit for sightless Voice Termometer, fire
and gas alarm system (by Ayhan
Dayanik):

ds1821.c

ds1821.h

isd2560.c

isd2560.h

voice.c

voice.h

Sample project (with circuit)
for SX28 that reads the temperature of a component I2C, the DS75,
and posts it on a LCD (by B.
Billy):

ds75.c

lcd_8.h

Interface to CompactFlash for PIC16F877 (some theory behind the
code can be found here)
(by Yann Hendrikx):

main.c

serial.c

serial.h

compactflash.c

compactflash.h

Bootloader
for PIC16F87x (by Niklas
Langmaack). (For full sources download
the whole package):

main.c

main.h

Frequency counter with output on 7-segment display (with circuit)
(by Kees van Nieuwburg):

fcounter.c

24-hour clock (with circuit)
with switching times stored in EEPROM and LCD output (HD44780) for
PIC16F84A (by Petr Mervart):

clock.c

display.c

display.h

eeprom.c

eeprom.h

The Lcd3Pin
program (with circuit)
shows how to use the 3-Pin Lcd-Library (by Gerhard Burger):

TLcd3Pin.c

Lcd3Pin.c

The FMeasure
program (with circuit)
shows how to measure the frequency on pin RB0 and write it to a
LCD-display (by Gerhard
Burger):

fmesure.c

Lcd6Pin.c

Code for a varitron 128 x 64 LCD display which use a T6363 LCD
controller with circuit
and detailed
description (1.4M) (by Jan van Gelder). The whole
package can be downloaded here
(1.6M):

lcd_examples.c

lcd873.c

lcd873.h

Sample project to control a Noritake 800A 128x64 pixel graphical
VFD display (by Henri
Skippari):

noritake.c

Virtual AD with 4 chanels for PIC16F628 with description
(by Julio Cesar Palacios
Reyes):

ADp.c

Beginner project with circuit
for PIC16F84, 7-segment indicator with common anode, 2 buttons and
IC sn74ls139. This project counts from 0000 to 9999 forward and
backward depending on which button is pressed (by Tzvetelin Velkov):

first.c

TIC TAC
TOE with "unbeatable AI" for the 16F628 with circuit
( by Chris Schmich, Zuofu Cheng, Ajay Upadhyaya University of
Illinois at Urbana-Champaign Engineering):

tactic.c

Electronic
dice project for PIC16C61 or PIC16F84 targets with circuit
( by Peter Kalosi):

dice.c

This 3 Wire example application demonstrates the use of a DS1302
Real Time Clock (by Don
Cramer):

main.c

3wireroutines.c

3wireroutines.h

uart.c

uart.h

This LCD sample application shows how to control HD44780-based
character LCD ( by Victor
Golutvin):

main.c

main.h

lcdfunc.c

Sample
application that demonstrates how to mix interrupts and use
interrupt driven receive features of the usart in the 16F877 chip by
Bert Drake.

Sample
application that commands a stepper motor with keys or I2C
commands (with circuit)
by Serge Gentner.

Code to drive a Toshiba T6963C based graphic LCD module (with circuit)
by Richard Taylor.

t6963.c

t6963.h

A vote application (with circuit)
that connects multiple nodes with RS422 network (by Gianni Franchi).

Main.cpp

Network.cpp

Network.h

Serial.cpp

Serial.h

Motor
Fader Automation system for SX target by [email-masked].

Delta
Force Mini Sumo Robot by [email-masked].

Line
Follower Robot by [email-masked].

4-Channel
DCC Block Detector by Nathan
Daniel Holmes.

The ghetto drum
system.

mTW523 -
the modified TW523 project by Neil Cherry.

Propeller
display device by [email-masked].

INC2H
converter. Utility to convert .INC file to C2C compatible .H
header files by John Nagle

Anybody brave
enough to write a bootloader in C and publish it here? (The price will be free C2C-plus and C2C++
licenses)

Series of samples for SX processors by Caribe Schreiber:

Using SX with EEPROM source
and header;

Using SX with LCD source
and header;

SX Port direction control source
and header.

Number of files that demonstrate how to access an external I2C
EEPROM from PIC16F877 (by Jamie Balfour). (Download)

Main.c

PIC
RegisterAddresses.h

Eprom
Access Functions.c

Eprom
Access Functions.h

Low
Level I2C Commands.c

I2C Low
Level.h

PIC16F877 code that demonstrates servo
control (by James
Gaston).

Sample
code for PIC12F629/675 processors that demonstrates how to
initialize and use gpio port, interrupts and register mapped
variables (by Pavel Baranov).

Sample
code for PIC16F628 processor that demonstrates how to use
register mapped variables and work with ports (by Pavel Baranov).

Series of examples from Joan
Ilari show how to start an application for PIC16F877:

Sample
#1 that uses interrupts and watchdog.

Sample
#2 that handles two time intervals via interrupts and uses
watchdog.

Sample
#3 that outputs a character to serial line using interrupts.

Sample
#4 that outputs a string to serial line using interrupts.

EEprom
read/write routines.

p16f877x.inc
variable definition for the above samples.

An example sxtest.txt
for the SX target.

Example from John
Wynia for Scenix micros UART
code .

Some examples from the PIC 'C' and Assembler
Resources by Julian
Winpenny:

An Interrupt driven Asyncronous
Serial Port by Julian Winpenny with
PIC
and MAX232
circuits.

I2C
Protocol implementation by Julian Winpenny with
circuit.

Example implementation of I2C
using PIC16F8XX MSSP module by Julian Winpenny.

LCD
Interface implementation by Julian Winpenny.

XModem
Send & Receive program with circuit
by Julian Winpenny.

Simple
Stepper Motor Driver with circuit
by Julian Winpenny.

Analog
to Digital Converter example by Julian Winpenny.

Many more
here

IR
remoute control project by Alexey Kotlov with description,
circuit and full sources.

Sound
Test Program for PIC by Makio Suzuki.

This page has been visited times
since August 2002.

Back Home

Microchip, PIC
and PICmicro are registered trademarks of Microchip Technology Inc.
Ubicom
and SX are registered trademarks of Ubicom Inc.
HI-TECH and PICC Lite are
registered trademarks of HI-TECH Software
Other trademarks and registered
trademarks used in this document are the property of their respective owners

Copyright © 1998-99, 2002-2004 Pavel Baranov