CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Proper way to rename/clone a CCS IDE project file?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 540
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

Proper way to rename/clone a CCS IDE project file?
PostPosted: Wed Feb 26, 2020 1:24 pm     Reply with quote

I made a generic project using the CCS PCD IDE Compiler wizard. I modified it to enable minor things like printf(), #case, etc.

I will then copy/paste the folder to a new name (still containing main.c, main.h, main.ccspjt) for different tests/experiments. This seems to work fine.

Today, I was doing a test to compare Multi-Unit Compile to the #include .c method. I copied the project to two new names in the same project directory (since I want them to use the same files). I gave them each a different Output directory and changed the project settings accordingly (one using multi-units, the other setting a #define that will cause the code to #include the .c files instead).

The new projects are "mainMultiUnit.ccspjt" and "mainInclude.ccspjt". I noticed the #include one, when building, creates a main.ccspjt (the original name the wizard main). There's clearly something in the project file I need to make sure to change.

There is a File -> Copy Project Files option, but in only seems to copy main.c (not the project file) when I tested it.

Ultimately, I want to have multiple project files in the directory so one will create a RELEASE version, and the other would have a DEBUG version with printf(), etc. enabled.

Thanks for any tips.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed Feb 26, 2020 5:47 pm     Reply with quote

The project file, in my experience, is prone to corruption. If I suspect it's corrupt, I close all files, then delete the project file (just the project file), then open the top level .c file only, recompile, and the project file is freshly created once more.

I have no experience with multiple compilation units, but if you had copied the two directories *but deleted the project files only*, I think that everything would have worked.
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Thu Feb 27, 2020 12:09 am     Reply with quote

Newguy's method is what I do.
Just copy everything, delete the .pjt & ccspjt files. Then open the primary
source and recompile. Project files are then created.
temtronic



Joined: 01 Jul 2010
Posts: 9176
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Feb 27, 2020 3:40 pm     Reply with quote

I'm probably doing it 'all wrong' but I have a 'project' subfolder in a 'device' folder. IE >18F46k22>greenhouse.
In that folder I keep local copies of the processor.H file, processor.fuses file, as well as LCDmodule, KPDmodule and RTCmodule drivers.
'main' project is copied and incremented. Say GHv1.c, GHv2.c, GHv99.c
I'll copy GHv1.c to GHv2.c, then edit a FEW lines, compile/test/save. The copy GHv2.c to GHv3.c, again..edit/compile/test.
Yes, I can and have a LOT of 'version' files BUT I can always go back, as many steps to figure out what I did wrong.... I don't bothe rabout cleaning up teh folders anymore... hard drives are huge !
Like I said, probably not the 'official' way but it's worked for me for decades and well, hard to teach this dog a new trick.

Jay
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Thu Feb 27, 2020 4:37 pm     Reply with quote

temtronic wrote:
....teach this dog a new trick.

Jay


Hi, I'm from the church of subversion...Have you heard about our lord & savior SVN?

Laughing
temtronic



Joined: 01 Jul 2010
Posts: 9176
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Feb 27, 2020 5:15 pm     Reply with quote

Like I said,too old... 66 and spent 1/2 my life 'playin with PICs'. My 'system' works for me and really if SVN was set to say 5 minute saves, I'd have 100s of versions of each program ! I can't type, get distracted( just petted Cloudy for 7 minutes....), go 'walkabout', coffee breaks, and really don't need another program or ap on this PC stealing machine cycles.
Jerson



Joined: 31 Jul 2009
Posts: 122
Location: Bombay, India

View user's profile Send private message Visit poster's website

PostPosted: Thu Feb 27, 2020 6:54 pm     Reply with quote

I too used SVN for a while. But now, I love the Fossil. Standalone, very powerful, scalable. Not GIT, not SVN, not mercurial, just the Fossil.
_________________
Regards
Jerson Fernandes
ccsHowTo



Joined: 01 Mar 2020
Posts: 5

View user's profile Send private message

Project-Files / Directory Structure / V4xx - V5xx
PostPosted: Sun Mar 01, 2020 11:38 am     Reply with quote

I have seen some odd behaviour with the project file *.PJT (CCS V4) and *.ccspjt (CCS V5):
- trying to open a *.PJT from an old V4 project under V5 yields a "read only" error
- over time I see a lot of projects some with the same name when I click on the file tab (no project open) and no way to get rid of them - how to figure out the
active name of all these duplicate names ?
- obviously the main file *.c must be open all the time ? If I close I need to go to the files tab and get the problem above !
Next issue - I tried a directory structure:
project_dir\_src for source files
project_dir\_inc for header files
-> works but needs #include "_scr\xxx.c" in the main.c and
#include "_inc\xxx.h” in other files
-> with project.c in _src and *.PJT / *.CCSPJT unter project_dir you end up
with all generated files under project_dir\_src despite the fact you
double-clicked project_dir\*.PJT or project_dir\*.CCSPJT
-> so project.c must be in project_dir\
Next issue - tried menu/options to define a include directory - ends up with a new (empty) project.c file ?!
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 12:41 am     Reply with quote

As already outlined, don't open .pjt or .ccspjt files. Delete these, then open
the primary code source file. Re-compile this, and new project files will be
created.
ccsHowTo



Joined: 01 Mar 2020
Posts: 5

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 1:12 am     Reply with quote

Thank you for your answer. What is still unclear for me:

Next issue - tried menu/options to define an include directory - ends up with a new (empty) project.c file ?!

I would expect a change according to my input, but not an empty file with the risk to lose the contents of the edited primary source file.

Another point - the manual I see in the download section describes the c-language extensions and function provided by CCS-C but I miss a manual describing details about installation, the interaction with MPLAB / MPLAB X and the function of the user interface like menus, submenus etc ?!

Yesterday evening I looked around in this forum and saw a lot of subjects which can normallly be found in such a manual.
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 1:40 am     Reply with quote

All stuff involving MPLAB or MPLAB-X, is nothing to do with CCS. You need
to go to the MicroChip forums for this.

MPLAB, is a MicroChip product, not a CCS product. They are hardly going to
write manuals for another companies products....

If you are setting an include directory, this is a _new_ directory.
ccsHowTo



Joined: 01 Mar 2020
Posts: 5

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 2:07 am     Reply with quote

Of course I meant: the function of the user interface like menus, submenus etc. for the

**** CCS software package (IDE, Download ... ) ****

.. in other words - a manual dealing with how to use YOUR software ..

I know that MPLAB and MPLAB X are products of Microchip and not your responsability.

In fact I developed quite a few products using MPLAB and later MPLAB X over the years and had very few poblems with it.
Ttelmah



Joined: 11 Mar 2010
Posts: 19375

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 3:23 am     Reply with quote

We are not CCS.
Just users.

However the CCS manual covers the whole CCS operation pretty solidly. So
not sure what you think is missing.....
jeremiah



Joined: 20 Jul 2010
Posts: 1329

View user's profile Send private message

PostPosted: Mon Mar 02, 2020 3:19 pm     Reply with quote

ccsHowTo wrote:

.. in other words - a manual dealing with how to use YOUR software ..

I don't disagree with your sentiment, but please make sure if you are looking for actual CCS support to make sure to email them ( support@ccsinfo.com ) or call them. There is a link at the top of the page for Official CCS Support with more options.

We'll try and help you here, but as stated above, we are just users.

My experience with the MPLABX integration. I install CCS from within MPLAB-X's dialogs. Look under tools->plugins and a dialog will pop up. In the "Available Plugins" section there is usually an option for CCS. I install it this way.

For some versions of MPLAB-X (almost all the current ones) you also have to modify your project settings to compile:

Go to File->Project properties and then in that dialog go to the CCS compiler options and include the correct paths in the "Include Directories" section. The path you want to add at a minimum is the "Devices" folder from your CCS installation folder. You might also have to add the "Drivers" folder as well. I don't know why MPLAB-X doesn't add them automatically anymore, but they used to.
allenhuffman



Joined: 17 Jun 2019
Posts: 540
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Mar 03, 2020 5:14 pm     Reply with quote

We use Perforce for our version control. It's method of "branching" is copying to a new directory, working on it there, then merging it back, so I am regularly opening projects in directories that do not match where they were created.

A "Project -> Save As" would be useful for my original question.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group