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 CCS Technical Support

Automated device select in PCH

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



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Automated device select in PCH
PostPosted: Thu Aug 31, 2006 12:53 am     Reply with quote

I use PCH inside MPLAB. I have applications that support multiple hardware platforms. Currently to compile an image I set a flag in the source code to select the target platform plus select the target PIC from MPLABs configure window. How can I embed the target PIC info into the source such that I do not have to manually reconfigure MPLAB each time I select a new target platform in my source code?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
bsodmike



Joined: 05 Aug 2006
Posts: 52

View user's profile Send private message Visit poster's website AIM Address MSN Messenger

PostPosted: Thu Aug 31, 2006 2:42 am     Reply with quote

Code:

#define HW_PLATFORM 1

#if HW_PLATFORM == 1
#include <16F648A.h>
#else
#include <otherdevice>
#end


Something like this?

You can also throw in fuse lines device lines etc into the various blocks...
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Aug 31, 2006 5:07 am     Reply with quote

This was the mechaism I tried but it does not work correctly.

For example if I specify a PIC18F8722 both in the code (as per your example) and as the device in the config window the code compiles correctly however if I select some other 18F family processor in the configure device menu like a PIC18F24J10 and select PIC18F8722 in the code then I get an error message of the form "The Extended Mode Configuration bit is enabled but...."
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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