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

Working With Multiple PIC Systems

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



Joined: 05 Jul 2010
Posts: 129

View user's profile Send private message

Working With Multiple PIC Systems
PostPosted: Mon Oct 18, 2010 4:57 am     Reply with quote

Good morning,

Does anyone here have any tips writing code for systems with multiple PICs in CCS?

Is it better to use #INDEF and then set the #DEFINE for each system as you compile/program it or does it make things too complicated? Would I be better having different projects for each PIC?

Cheers,
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Mon Oct 18, 2010 7:48 am     Reply with quote

For me, it's one project per application/component.

One of my recent systems went through three revisions. Different board and PIC for each as the final system specifications were narrowed down. I just set up conditional compilation, eg "#ifdef REVx" and used that to define the correct pin (and other) constants and bring in the correct device header. getenv() can be very handy. The vast bulk of the code was generic and shared among all revisions. Hence, just the one project.

For another system made up of several components, each component is its own project.
_________________
Andrew
sturnfie



Joined: 26 Apr 2010
Posts: 17
Location: Palatine, IL

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

PostPosted: Mon Oct 18, 2010 10:22 am     Reply with quote

I prefer to go with one application/component, but that's mostly because I don't mind the overhead of the extra project files. When working on a multiple PIC project set, there is usually only one file different in each project. In this file I place the unique application code for that PIC.

All shared code is placed in external shared libraries (the intercommunication code, most importantly) and pulled in via in-line #includes (_NOT_ local copies found in each project folder).

I find value in this approach as it separates the revision history of each portion of the larger project into individual branches (per component and per shared-library). Also, for multi-developer projects, it by-passes the merge conflicts that occur when multiple people are concurrently modifying a single, multiple application, file.
_________________
Lucas Sturnfield
Blog - http://www.sturntech.com/blog
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