![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Guest
|
Difference between PCH / PCM / PCB |
Posted: Tue Jan 06, 2009 3:58 am |
|
|
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)
|
|
|
![](templates/subSilver/images/spacer.gif) |
andyfraser
Joined: 04 May 2004 Posts: 47 Location: UK
|
Difference between PCH / PCM / PCB |
Posted: Tue Jan 06, 2009 7:48 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Tue Jan 06, 2009 8:00 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|