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

Header file p30f3013.h error

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



Joined: 03 Dec 2012
Posts: 19
Location: kerala

View user's profile Send private message

Header file p30f3013.h error
PostPosted: Fri Dec 28, 2012 1:32 am     Reply with quote

Hi

i am using a code for communicating with the UART1 of dsPIC30f3013. For that i have included the header file C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h

as #include <p30f3013.h>. But after compilation i got lot of errors inside this header file

error shows : *** Error 36 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(36,41): Expecting a ; or ,
*** Error 43 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(49,50): Expecting a declaration
*** Error 43 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(50,51): Expecting a declaration
*** Error 48 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(51,58): Expecting a (
*** Error 48 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(59,73): Expecting a (
*** Error 48 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(74,84): Expecting a (
*** Error 43 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(85,86): Expecting a declaration
*** Error 43 "C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h" Line 66(86,87): Expecting a declaration


I am getting more than 100 errors.

it happens wherever the registers are declared for example

Line NO:66 and 67 are

extern volatile unsigned int WREG0 __attribute__((__sfr__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG1 __attribute__((__sfr__,__deprecated__,__unsafe__));


I am using the CCS compiler. Should i link the linker file to the application.
Simply including the header file is not working. How to add a link file.

Please help me. I am doing a time bound project and i am new to PIC programming. It may be simple for you but i am stuck with it. Please help me
_________________
I dream world peace
aroonkriss



Joined: 03 Dec 2012
Posts: 19
Location: kerala

View user's profile Send private message

Header file p30f3013.h error
PostPosted: Fri Dec 28, 2012 2:28 am     Reply with quote

Hi All,

Anyone knows the answer. It might be simple for you as you have done lot of projects. This is my first project with PIC. No one to guide me. So i can approach only you guys. So please respond. any help would be appreciated

Thank you
_________________
I dream world peace
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Dec 28, 2012 2:55 am     Reply with quote

I suspect this is the old MPLAB problem. It sounds possibly as if you are working through this?.
If so, you must _never_ 'include' CCS .h files, in the 'source files' part of the project. They must be in the 'header files' section. If you put them in the source files part, the compiler tries to compile these separately. They then won't work.....

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 28, 2012 2:47 pm     Reply with quote

Quote:
I have included the (C30) header file:
C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\h\p30f3013.h
But after compilation i got lot of errors inside this header file.
I am using the CCS compiler.

Can CCS accept a header file from the C30 compiler ? I don't have
the CCS PCD compiler, but I doubt that it can use C30 files.
newguy



Joined: 24 Jun 2004
Posts: 1900

View user's profile Send private message

PostPosted: Fri Dec 28, 2012 3:05 pm     Reply with quote

Ttelmah wrote:
I suspect this is the old MPLAB problem. It sounds possibly as if you are working through this?.
If so, you must _never_ 'include' CCS .h files, in the 'source files' part of the project. They must be in the 'header files' section. If you put them in the source files part, the compiler tries to compile these separately. They then won't work.....

Best Wishes


Take a look at the file path in his list of errors - he's trying to compile a C30 header file with the CCS compiler. Square peg, round hole.

aroonkriss: you need to work through or at least read some of the CCS examples first. You can't take files written for another compiler and expect them to work in another.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Dec 28, 2012 3:53 pm     Reply with quote

Yes. Like putting diesel in a petrol engine....

Best Wishes
aroonkriss



Joined: 03 Dec 2012
Posts: 19
Location: kerala

View user's profile Send private message

Header file p30f3013.h error
PostPosted: Fri Dec 28, 2012 10:44 pm     Reply with quote

Hi...

Thank you all for your reply Very Happy yep that was my mistake. Just a 'fall before the rise'.

Actually I was using the header file C:\Program Files\PICC\Devices\30F3013.h, then I had a problem with UART1 which wasn't responding. So someone suggested me to go for p30f3013.h file in MPLAB c30 folder. I used it and came up with lot of errors. That was why I posted the problem. Now I am using the Files\PICC\Devices\30F3013.h and the instructions:
Code:

#use rs232(baud=9600,parity=N,xmit=PIN_F3,rcv=PIN_F2,bits=8,stream=UART1)

setup_uart(TRUE);

Now the UART1 is working fine. Smile

Earlier I tried with:
Code:

#use rs232(baud=9600,parity=N,xmit=PIN_F3,rcv=PIN_F2,bits=8,stream=UART1)
#byte U1MODE=getenv("SFR:U1MODE")
#byte U1STA=getenv("SFR:U1STA")

bit_set(U1MODE,15);
bit_set(U1STA,10);

without using setup_uart(TRUE);
but it didn't work. I used the \PICC\Devices\30F3013.h file. May I know why I couldn't set the bits? Did i do anything wrong? Any help would be appreciated.
_________________
I dream world peace
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