Difference between revisions of "PIC MCUs: Software"

From Mech
Jump to navigationJump to search
Line 5: Line 5:


==Project Basics==
==Project Basics==
The basic process taken when developing and programming in Windows IDE follows a few steps. First, a source code is created using [[C programming]] language. Next, using the ''Compile'' button (in the Compile Menu) a number of different files are created, including a .hex file which is used directly to program the MCU. Finally, the .hex file is loaded onto the MCU using the ''Program Chip'' button (also in the Compile Menu).

Although the programming done in the Windows IDE is done by directly editing only the source file, many other files will be generated upon compiling the source file. All of these files will be saved into the same directory as the source file, and will have the same name (with different file extensions). A list of file extensions and their meanings is given below.
Although the programming done in the Windows IDE is done by directly editing only the source file, many other files will be generated upon compiling the source file. All of these files will be saved into the same directory as the source file, and will have the same name (with different file extensions). A list of file extensions and their meanings is given below.
<br>
<br>
{| border="1" cellspacing="2" cellpadding="1" align="center"


{| border="1" cellspacing="2" cellpadding="3" align="center"
|-
|-
!Extension!! Meaning
!Extension!! Meaning
|-
|-
!.c || Source code file
|.c || Source code file
|-
|-
!.cof ||Binary machine code file
|.cof ||Binary machine code file
|-
|-
!.err||Listing and description of any errors
|.err||Listing and description of any errors
|-
|-
!.esym||IDE file containing comment information and definitions from header file
|.esym||IDE file containing comment information and definitions from header file
|-
|-
!.hex||Programmable output file compatible with all programmers
|.hex||Programmable output file compatible with all programmers
|-
|-
!.lst||Line by line listing of source code along with generated assembly code
|.lst||Line by line listing of source code along with generated assembly code
|-
|-
!.pjt||Main project file
|.pjt||Main project file
|-
|-
!.sta||Memory usage summary (statistics)
|.sta||Memory usage summary (statistics)
|-
|-
!.sym||List of symbols used and their corresponding registers
|.sym||List of symbols used and their corresponding registers
|-
|-
!.tre||Shows every function used in the source code, and the memory used by each
|.tre||Shows every function used in the source code, and the memory used by each
|-
|-
|}
|}

<br>


==Debugging==
==Debugging==

Revision as of 10:56, 26 June 2007

The CCS C Windows IDE is a software package that includes a source code editor, a C compiler, and an interface with a programming device (such as the ICD-U40). Together, these three components make up an Integrated Development Environment, or IDE. The general purpose of the IDE is to allow the user to create and edit a source code in C, then compile and program that code into a PIC microcontroller.

Install and Setup

Installing the CCS C Windows IDE is quite straightforward. Simply run the setup file from the C Compiler installation disk, and follow the on screen instructions. At a certain point in the installation, the installer will request a directory to be used for program storage. The default will be C:\Program Files\PICC\Projects , however you may wish to change this depending on where you would like your projects to be stored.

Project Basics

The basic process taken when developing and programming in Windows IDE follows a few steps. First, a source code is created using C programming language. Next, using the Compile button (in the Compile Menu) a number of different files are created, including a .hex file which is used directly to program the MCU. Finally, the .hex file is loaded onto the MCU using the Program Chip button (also in the Compile Menu).

Although the programming done in the Windows IDE is done by directly editing only the source file, many other files will be generated upon compiling the source file. All of these files will be saved into the same directory as the source file, and will have the same name (with different file extensions). A list of file extensions and their meanings is given below.

Extension Meaning
.c Source code file
.cof Binary machine code file
.err Listing and description of any errors
.esym IDE file containing comment information and definitions from header file
.hex Programmable output file compatible with all programmers
.lst Line by line listing of source code along with generated assembly code
.pjt Main project file
.sta Memory usage summary (statistics)
.sym List of symbols used and their corresponding registers
.tre Shows every function used in the source code, and the memory used by each


Debugging

Windows IDE Basics