■ Screenshot 5. The CCS C Compiler Project
Wizard is an interlocked set of selection
windows. If we decide to do something that
affects the decisions available elsewhere in the
process, the Project Wizard takes care of the
■ Screenshot 6. There's not
a bunch to comment on
here. The check box
selections say it all.
to generate the alias and pin direction code for us. You
can see how tough an assignment this is in Screenshot 4.
All we have to do is name pin A2 (provide an alias) and
designate it as an output pin. That’s all there is to it.
Now, you’re thinking we have those RS-232 pins
defined. What if I accidentally “reassign” their functions?
Most of the time, the less extra fluffy stuff you see in
your source code, the better. However, I’m the kind of
guy who likes to have total visual access. So, I chose to
display all of the PIC18F27J13’s fuse settings. I’m also a
fan of placing the opening braces of functions and such
on the following line. All of that is evident in Screenshot 6.
Well, the CCS compiler software folks are way ahead of
you. Check out Screenshot 5. The I/O pins that are
natively assigned to the EUSART have been reserved for
Now that you know I’m a configuration fuse freak, I verify
this extremism by electing to populate the check boxes in
the Fuses area of the Project Wizard. My personal fuse
preferences are reflected in Screenshot 7.
Pins C6 and C7 are multiplexed with other functions.
Our specifying their functionality in Screenshot 2 carries
over to the I/O pin definitions that reside in Screenshot 5.
What Have We Done?
Well, nothing much yet. However, with the click of
the Create Project button, an include file and a main
project file are created. Each of the newly generated files
contains code and definitions based on selections we
made in the Project Wizard windows. Here are the
contents of the main.h file:
■ Screenshot 7. I really could have left these check boxes
alone, but NOOOOO.
//Stack full/underflow will cause reset
//Code not protected from reading
//Digital mode, I/O port functionality of
//RC0 and RC1
//I/O function on OSC2
//Fail-safe clock monitor disabled
//Internal External Switch Over mode disabled
//DSWDT uses INTRC as reference clock
76 March 2015