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

PCWH version 5 with MPLab X

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



Joined: 28 Sep 2014
Posts: 4
Location: New Zealand

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

PCWH version 5 with MPLab X
PostPosted: Sun Sep 28, 2014 4:46 pm     Reply with quote

Hi,

I've been using PCWH version 5 with MPLab 8 but now that I'm switching to a new computer (Win7) it is time that I switched to MPLab X. I'm finding that the basic instructions don't solve my issues, and the fuller instructions don't give the overview. Where is the best information to refer to?

It seemed clear (although not explicitly stated) that I had to install CCS-C before MPLab X. The following gives some good basic instructions on getting started:
http://www.ccsinfo.com/pdfs/mplabx_ccs_tutorial.pdf

The CCS IDE supports multiple compiler versions from the help - about window. I was easily able to install the versions I've used for significant past projects and select the default to use. MPLab X does not seem to recognise multiple compiler versions installed in this manner. Following the tutorial instructions to recognise other CCS C versions doesn't work. Having developed projects over a few years I'm well aware the unexpected problems that arise when changing compiler versions. I was looking forward to MPLab X being able to link a project to a specific compiler version.

The tutorial also states that "If you insert more than one source C file into your project, MPLAB X will call the
CCS C Compiler multiple times to compile each C file separately." This will really screw up my old projects since they were arranged to compile only one c file that has #include(d) a number of .h and .c files. Things seemed relatively simple doing it that way - I don't need the complexity of multiple compilation units. Is this structure no longer recommended and if so what should I be doing instead?

Thanks in advance for your answers. If they can be in a form that will help users other than me, all the better.
_________________
Paul Wolstenholme
www.IndustrialControl.co.nz
temtronic



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

View user's profile Send private message

PostPosted: Sun Sep 28, 2014 5:20 pm     Reply with quote

'If it ain't broke, don't fix it' ! philosophy....

Unless there's a REAL reason to 'jump ship' and 'upgrade', don't! I'm still using PCM V4xxx with mplab v8.6x on an XPP machine and everyone's happy.

You've invested a LOT of time getting things just right so why bother 'upgrading'? You'll have days if not weeks of 'fun' trying to figure out 'it worked before I 'upgraded'...

If you really do switch be sure to have 100% backups of everything.In fact I'd just buy a new PC and start fresh, keeping the old PC with WORKING systems next to you. PCs are dirt cheap(throw aways up here) and i have 3 complete working systems even a WIN98se unit.

just food for thought.

Jay
jeremiah



Joined: 20 Jul 2010
Posts: 1336

View user's profile Send private message

PostPosted: Sun Sep 28, 2014 6:56 pm     Reply with quote

You can right click on each file in the project window and go to properties for the file itself. In that there is a checkbox that controls whether that file is compiled or not. Kind of annoying to do a bunch of files manually like that, but that is how I worked around the issue.
PaulWolstenholmeNZ



Joined: 28 Sep 2014
Posts: 4
Location: New Zealand

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

PostPosted: Mon Sep 29, 2014 3:22 pm     Reply with quote

Thanks for your replies.

The first point is valid - we are maintaining our old system as long as possible for support, but not new work. I can't even find MPLab 8 on the Microchip website any more (www.microchip.com/mplab8 redirects to MPLab X) so I don't want to rely on it.

Thanks for the tip that file properties can exclude files from compilation.

I'm still learning about the differences in approach to file handling. If I use 'import MPLAB legacy project' I get a project that hasn't copied any files, just linked to my old project files. It make me take some time to get used to the terminology differences! Any learning shortcuts would be appreciated.
_________________
Paul Wolstenholme
www.IndustrialControl.co.nz
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 3:56 pm     Reply with quote

Quote:
I can't even find MPLab 8 on the Microchip website any more

It's all here. You can download any prior version:
http://www.microchip.com/pagehandler/en-us/devtools/dev-tools-parts.html
PaulWolstenholmeNZ



Joined: 28 Sep 2014
Posts: 4
Location: New Zealand

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

PostPosted: Tue Sep 30, 2014 9:28 pm     Reply with quote

This is my understanding of the best approach to to using MPLab X with CCS-C when you also have the CCS IDE:

1) Don't install CCS-C to the default path. Add the version number to the path so that you can install multiple versions of CCS-C (e.g. C:\Program Files (x86)\PICC\5.012). Also add the version number to the start menu location (e.g. PICC\5.012). You can also rename the desktop shortcut to include the version. Install your latest version last so it becomes the windows default when opening files.
Reason: Although you end up with the IDE installed multiple times, you do get each version of the compiler associated with the versions of the device and driver files that apply to that compiler. MPLab X can also recognise these separate installations AND you tell which version it is within MPLab X because of the file naming.
In the CCS IDE, do NOT use ?(help) - about - update compiler to install new compiler versions because it will stop MPLab X from using the old compiler and it can replace device and driver files.

2) After creating a MPLab X project, copy (or create) all .c and .h files into the project folder directly - not into a sub-folder.
Reason: MPLab X creates a .ccspjt file there that can readily be used to open the project in the CCS IDE. If the .c and .h files are in a sub-folder, the CCS IDE creates another .ccspjt file there and confusion will arise, such as where the ..Notes.txt file will be located.
The 'import legacy mplab project' wizard lacks the convenience of having the entire project contained within the project folder because it refers to the .c and .h files located in your legacy project folder, so don't use that to create the MPLab X project.

3) To tell MPLab X what files are involved, right click important files - add item... . Select all the files in the project folder (except the Makefile). Expand the list under Important files then drag the compilable .c file to Source Files and header files to Header Files. MPLab X then knows which one to compile and doesn't attempt the others. This assumes you are following the CCS-C manual's section entitled "Multiple Project Files" (using "Multiple Compilation Units" would be slightly different).

4) In setting up the project you will probably have realised that you sometimes want to debug on hardware (via ICD-3 or similar) and sometimes debug with the simulator (which can step into an interrupt, for example). In MPLab X, simply customize the "default" configuration (as shown in the drop-down on the MPLab X ribbon) to create 2 configurations within your project.

5) After your first compile in MPLab X, you can open the CCS IDE by double-clicking the .ccspjt file (unless you want to use an older version of the IDE). No additional project setup is required. You may wish to use 'clean' to remove compiled files as they clutter the project folder when compiled this way (MPLab X places them in other folders). Unfortunately the .hex file will remain and shouldn't be confused with the .hex file MPLab X places in a sub-folder.

I hope this helps someone get to the same point more quickly.
_________________
Paul Wolstenholme
www.IndustrialControl.co.nz
jeremiah



Joined: 20 Jul 2010
Posts: 1336

View user's profile Send private message

PostPosted: Wed Oct 01, 2014 10:37 am     Reply with quote

Some notes:
1. Out of curiousity, have you tried seeing if the pcwhd executable takes command line arguments to switch compiler revs through their new mechanism? I haven't, but if they have that option, it might better than having to use multiple installations now.

2. You can use subfolders if you leave your main file in the main folder and put the rest in the subfolders you want, then the project file should be only generated where the main file resides.
Ttelmah



Joined: 11 Mar 2010
Posts: 19439

View user's profile Send private message

PostPosted: Wed Oct 01, 2014 11:21 am     Reply with quote

You'd have to include all the paths for include etc.. The compiler uses the path statement, then the project files, to control it's search order. PCM_programmer ran into this when he tried to do a historical compile on a project in a thread a little while ago, and it insisted on using the wrong include files.
It is unfortunately not well designed at all.
PaulWolstenholmeNZ



Joined: 28 Sep 2014
Posts: 4
Location: New Zealand

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

PostPosted: Wed Oct 01, 2014 2:15 pm     Reply with quote

In response to jeremiah:

1. I avoided what you call the 'new mechanism' because it doesn't support different device and driver files for each compiler version. I had found a posting by Ttelmah that alerted me to this issue and problems with other workarounds.

2. Thanks. I hadn't tried that.

In response to Ttelmah:
I've always found it wise to follow your suggestions.
jeremiah



Joined: 20 Jul 2010
Posts: 1336

View user's profile Send private message

PostPosted: Wed Oct 01, 2014 3:38 pm     Reply with quote

PaulWolstenholmeNZ wrote:
In response to jeremiah:
1. I avoided what you call the 'new mechanism' because it doesn't support different device and driver files for each compiler version. I had found a posting by Ttelmah that alerted me to this issue and problems with other workarounds.


I can understand that. That normally hasn't been an issue for me because, as a rule of thumb, I don't link to the device and driver files in the installation folder. I always make a copy and put it in my project locally. Take into consideration I keep the old revs merely for compatibility with old projects, so having the local copy of the files works fine for me. If my old projects linked to the install folder for device/drivers or if I wanted to start a totally new project with an old compiler version, then not having the old device and driver files would definitely be an issue for me.
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