Robots - Notes
- CC5X and PARTS Mark III Controller
This tutorial describes installing and using the
free evaluation version of
B Knudsen
Data's CC5X C Compiler for PICmicro Devices, Version 3.2 along with the
latest Microchip MPLAB IDE v7.51, to program the PARTS Mark III controller.
Installation and testing was done on a fresh installation of Windows XP
Professional with SP2.
A "One Pin" LED circuit was connected to J1 Pin 40 (Port D Bit 0). The
example program blink.c causes the LED to toggle from
on to off at about 4.2 times a second.
- Download and install Microchip MPLAB IDE
MPLAB IDE v7.51 Interim Release – Full Zipped Installation
http://ww1.microchip.com/downloads/en/DeviceDoc/MP751.zip
- Download and install free evaluation version of
B Knudsen
Data's CC5X C Compiler -
http://www.bknd.com/cc5xfree.exe
Tip: Richard Stofer recommends installing cc5x in C:\CC5X to avoid embedded spaces in the path. It makes it a lot easier when running
from the command line or from batch files. This is certainly true; however, for the purpose of this tutorial, the default is used.
- Create directory for project and place C program there. Example
c:\proj1\blink.c
In MPLAB IDE v7.51 do the following:
- Project > New Project
Set "Project Name". Example
Blink LED
Set "Project Directory" to location where C program is stored. Example
c:\proj1
- Project > Select Language Toolsuite...
Set "Active Toolsuite:" to B Knudsen Data CC5X
Set "Location" to C:\Program Files\bknd\CC5X\CC5X.EXE
- Project > Build Options > Project
Set "Include Path, $(INCDIR):" to location of CC5X include files.
Example "C:\Program
Files\bknd\CC5X"
Important! Add quotation marks around path and remove \ from end of
path!
Do not use C:\Program Files\bknd\CC5X\
- Project > Add Files to Project
Navigate to directory where C program is store.
Set "File Name" to name of C program. Example
blink.c
Set "Files of Type" to Source Files (*.C;*.ASM)
- Configure > Select Device...
Set "Device:" to PIC16F877
- Project > Build
If this is successful a "BUILD SUCCEEDED" message will be displayed.
A hex file suitable for loading into the Mark III controller will be found in
the
project directory. Example c:\proj1\blink.hex
FAQ - Frequently Asked Questions
Please email if you found any errors or have suggestions on how I could improve this tutorial.
Thanks to Dave HyLands
for the starting place for this article.
If you have any questions or comments about this page please email me at: debots_replacethis_dinkdaze.org with at sign.
|