How to use 44-pin demo-board of PICkit 2 set
with PIC16F887
as a brain of small home-made robot.
How to use in robotics light/image sensor of cheap
optical mouse as a local position finder.
How to use cheap optical mouse instead of gyroscope.
Source code in C for PIC16F887 for this.
Demo version of CCS PIC C Compiler (PCM)
How to install it and use with (and without) MPLAB
Step-by-Step guide for beginners
This article describes a process of installation of demo version of CCS PICC compiler,
shipped with PICkit 2 programmer.
PICkit 2 Debug Express -'Insert First' CD.
When you insert this CD, you see this screen (if you turn on autorun feature for your CD drive):
Install Debug Express 12 Lessons Files:
The code of examples, will be installed from CD, by clicking the file:
D:\Install\Lessons\44PinDemoBdLessonsSetup.exe
PIC16F887 Lessons Setup Wizard window
Normally it should be installed to directory:
C:\Pk2 Lessons\44Pin Demo Board\
Install CCS C Compiler Plug-In for MPLAB 6 from file:
D:\ThirdParty\CCS Compiler Demo\setup_mplab_plugin.exe
Default way is:
C:\Program Files\PICC\
Install CCS compiler (PCM demo version) from
D:\ThirdParty\CCS Compiler Demo\SetupCCSC887.exe
PCM Default Destination Location also is
C:\Program Files\PICC\
After the installation, the directory
C:\Program Files\PICC\
Should contains these files:
After the installation, normally you will see the icon of the PIC C compiler:
PIC C Compiler Icon.
If you run: Start/ All Programms/ PICC Version, you will see:
CCS C Compiler PCM Version
Note (!): This compiler can produce code only for one type of PICs - PIC16F887.
It is funny, but there is only one header file in the include directory:
"c:\Program Files\PICC\Devices\16F887.h"
Now it is time to run MPLAB.
And create project for C code example
MPLAB IDE 7.60 Icon.
Click it and run MPLAB IDE.
MPLAB - Project/ Project Wizard.
Project Wizard start.
Step one - select a device (In our case it is PIC16F887).
Step Two: Select a language toolsuite - CCS C Compiler for PIC12/14/16/18
Note: It is possible to use several language tools with MPLAB.
As you see it is possible to program PICs with assembler, Basic and C.
Pay attention to the fact - there are several C compilers for PICs.
CCS C compiler is not the only one C compiler for PICs
As you see there is a red cross near CCS C Compiler.
This means MPLAB doesn't know where the compiler is located.
We should help MPLAB and point to the compiler's location, using button 'Browse'
Choose:
C:\Program Files\PICC\Ccsc.exe
Red cross near CCS C Compiler disappeared.
Choose new project file.
Directory is C:\Pk2 Lessons\44Pin Demo Board\C Projects\CCS
Project file name 'MyProject01'
Project file name 'MyProject01'.
Project file name 'MyProject01'.
Add to the project source file 'CCS_44P_Demo.C'
Project Summary.
Compile the project.
BUILD SUCCEEDED.
After the compilation you HEX file appears in the project directory:
CCS_44P_Demo.hex
Also it is possible to run CCS C compiler without MPLAB
(Not recommended)
Also it is possible to run CCS C compiler without MPLAB.
Just click on file C:\Program Files\PICC\Ccsc.exe
PIC C Compiler - Default Working Window.
PIC C Compiler - Error screen.
PIC C Compiler - Working Window with real file name.
(You should place here real name of existing source file)
PIC C Compiler - Result of Compilation.
Supported devices:
* Indicates new parts supported with v1.40 of the device file.
+ Indicates parts that require 4.75V minimum VDD for programming.
PICkit 2 may not be able to generate sufficiently high VDD,
so an external 5.0v power supply may be required.
# indicates Midrange parts that support low Vdd programming
Serial EEPROM Devices
---------------------
NOTE: Other supported voltage grades are listed in paratheses
next to the device. Select the "LC" part number to program
these other voltage grades.