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

PIC Program Intercompatibility

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



Joined: 30 Apr 2010
Posts: 1

View user's profile Send private message

PIC Program Intercompatibility
PostPosted: Fri Apr 30, 2010 8:48 am     Reply with quote

I've got some C source code here which was designed to run on the 16F648. Because i've only got the 16F887 handy, would this program run on that too? I've changed the header file and it seems to have compiled ok? Is there any way of checking intercompatibility between mcu's?

(Sorry, i'm new to this)

Many Thanks in Advance
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Fri Apr 30, 2010 11:56 am     Reply with quote

Intercompatibility
PIC's are pretty good in this regard. Now small featured MCU's can't be given big features with code. Typically if it compiles you are probably good to go.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Fri Apr 30, 2010 12:22 pm     Reply with quote

If the code is "normal" - ordinary C code - you're fine. If the original code refers to registers within the processor, you might not be fine.

Look for things like:

Code:
#byte SOME_REGISTER = 0xc7


or

Code:
#org


If you see things like that, you'll have to make sure that the code refers to the same (or equivalent) register or memory location/range in the new processor as with the old.
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