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

Difference between PCH / PCM / PCB

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








Difference between PCH / PCM / PCB
PostPosted: Tue Jan 06, 2009 3:58 am     Reply with quote

Hi,

What is the difference between using of PCH / PCM / PCB as below (if defined(__PCH__)),
What happens if we did not mention it ?

Code:

#if defined(__PCH__)
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=20000000)

andyfraser



Joined: 04 May 2004
Posts: 47
Location: UK

View user's profile Send private message

Difference between PCH / PCM / PCB
PostPosted: Tue Jan 06, 2009 7:48 am     Reply with quote

Hi,

These are automatically defined by the compiler so as to include the correct code for the series of PIC the compiler is designed for. You do not need to declare these yourself.

HTH

Andy
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Jan 06, 2009 8:00 am     Reply with quote

The line "#if defined(__PCH__)" is known as a conditional and is used to include/exclude portions of code based on which compiler is being used. In this case the section of code will only be included if you are using the PCH compiler otherwise it will be ignored. As Andy said, the compiler automatically defines the appropriate one based on which compiler it is.

For example, since 16F and 18F chips have different requirements, CCS uses the conditionals so one example can be used with the different CCS compilers.
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