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

#device error when compile for PCWH ver 3.185

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



Joined: 26 Mar 2004
Posts: 3

View user's profile Send private message

#device error when compile for PCWH ver 3.185
PostPosted: Fri Mar 26, 2004 2:59 am     Reply with quote

Hi,

Alway encounter this error when doing pre-processor setting.

codes:

#if defined(__PCH__)
#include (18F8620.h)
#endif

#device adc=10 <-- A #device is required before this line

or

void main() <-- A #device is required before this line

(actually, it happens to any statement that is planted here)

Any advise? :sad:
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Mar 26, 2004 3:46 am     Reply with quote

One of the first lines in your code needs to be
#device PIC18F8620

All other #device lines without the type number in it just add up to the already existing define.

Obviously your __PCH__ is not defined!
I can tell this from the next line containing an error and your compiler not complaining.

Quote:
#include (18F8620.h)


This is gramatically wrong, replace the '()' by '<>':
#include <18F8620.h>


Why don't you just leave the test for __PCH__ anyway? You allways need to include the 18F8620.h

Example:
// My example prog
#include <18F8620.h>
#device adc=10

void main()
{
}
pkwek



Joined: 26 Mar 2004
Posts: 3

View user's profile Send private message

Still not working.
PostPosted: Sun Mar 28, 2004 7:47 pm     Reply with quote

Thanx for the reply for the problem!

I have changed the codes to

#include <18F8620.h>
#device adc=10
void main ()
{}

But when i compile, 18F8620.h opens up and shows this error:

unknown device type try --PCH

:sad: How?
dyeatman



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

View user's profile Send private message

Use Compiler Select
PostPosted: Sun Mar 28, 2004 8:05 pm     Reply with quote

If you are using PCWH then you need to change from 14 bit device to 16 bit device on the menu bar. If the option is not showing you have to right click on the blank area of the menu bar, choose Customize and add the Compiler Select menu bar.

Dave
pkwek



Joined: 26 Mar 2004
Posts: 3

View user's profile Send private message

PostPosted: Sun Mar 28, 2004 9:15 pm     Reply with quote

Thanx!

Everything's ok when i set the compiler select menu to MicroChip PIC18!!!
Earlier on, this compiler select menu was not on the toolbar.

Ready caught me. Thought it was already selected proper. I was working on PIC16 previously.

Thanx man! :grin:
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