Frequently Asked Questions
Compiling a Program from an Existing File/Project
- Open the CCS PCW IDE and select File -> Open from the ribbon along the top of the main window or from the menu bar if using the classic style IDE. Make sure that the name of the project to compile appears at the bottom of the IDE Editor window. If the project is already opened, multiple projects are open, or the project name does not appear at the bottom of the editor, right-click on the program you want to compile and select Make File Project from the pop-up menu.
- Select Compile to view the compiler options. From the drop-down menu, select the type of compiler to use for compiling the program. There are four types of compilers:
CCS C Compilers |
Compilers |
Purpose |
PCB 12 |
Uses the 12-bit compiler for 12-bit PIC® MCUs. |
PCM 14 |
Uses the 14-bit compiler for 14-bit PIC® MCUs. |
PCH 16 |
Uses the 16-bit compiler for 16-bit PIC® MCUs. |
PCD 24 |
Uses the 24-bit compiler for 16-bit PIC® MCUs and PIC® DSCs. |
- Select Options -> Project Options from the ribbon along the top of the main window or from the menu bar if using the classic style IDE. In the Project Options window that appears, there are four different sections that allow for changes to be made to the compiler operation:
Project Options |
Options |
Purpose |
General |
Allows source files to be added and removed from the current project. |
Include Files |
Allows directories to be specified to search for header files needed for the project. By default, the CCS C Compiler directories for Devices and Drivers should appear in the list. |
Global Defines |
Allows the creation of #define statements to be used during compiling. |
Output Files |
Allows changes to the format and types of output files created during compilation. |
- To compile the files in a project, select Compile from the ribbon along the top of the main window or from the menu bar if using the classic style IDE, and select one of the following options:
Compilation Options |
Options |
Purpose |
Build |
Compiles units that have changed since the last compilation and rebuilds the project. |
Build and Run |
Performs a build and then programs the image to the microcontroller using the selected programming tool. The microcontroller then runs the new program. |
Compile |
Compiles the current unit. |
Rebuild |
Compiles all the units and builds the project. |
Clean |
Deletes the output files for the project. |
- After the program is compiled, a prompt will appear showing the types of files created and the amount of ROM and RAM used by the program. Press any key to close the window or it will auto-close after a certain amount of time has passed. The program can then be used for programming or debugging purposes.
For additional help using the CCS C Compiler, contact CCS Technical Support.