compilation problem

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

compilation problem

Postby yasotha padmanathan » Mon Feb 27, 2012 3:37 pm

hi,
i hv build a coding i hv downloaded from cytron which is the PR25 project coding. but the source file oni consist (.c) file. I cant able to edit the coding and build it coz it asking for the .h(header file) file....i dont know hw to solve this prob. any1 can guide me hw to build the program successfully?
yasotha padmanathan
Novice
 
Posts: 17
Joined: Sun Oct 16, 2011 10:21 pm

Re: compilation problem

Postby ABSF » Mon Feb 27, 2012 3:56 pm

The <pic.h> is in your Hi-Tech C compiler directory inside "include" sub-directory.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: compilation problem

Postby hyng » Tue Feb 28, 2012 9:01 am

Here is a tutorial on how to create a project in MPLab. http://tutorial.cytron.com.my/2011/08/18/how-to-create-a-project-in-mplab-ide/
Hope you can find a solution from there. 8-)
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: compilation problem

Postby yasotha padmanathan » Tue Feb 28, 2012 11:59 am

that tutorial was very2 helpful...thx alot for helping. I shall try it nw. :)
yasotha padmanathan
Novice
 
Posts: 17
Joined: Sun Oct 16, 2011 10:21 pm

Re: compilation problem

Postby yasotha padmanathan » Tue Feb 28, 2012 2:11 pm

hi, i followed exactly like the tutorial but yet i encounter problem when building. still it says couldnt locate the pic.h file. :(
Attachments
Untitled.png
yasotha padmanathan
Novice
 
Posts: 17
Joined: Sun Oct 16, 2011 10:21 pm

Re: compilation problem

Postby ABSF » Tue Feb 28, 2012 2:25 pm

yasotha padmanathan WROTE:hi, i followed exactly like the tutorial but yet i encounter problem when building. still it says couldnt locate the pic.h file.


But you chose the wrong compiler MCC18 which is for the 18Fxxx family. You should select "HI-TECH ANSI C COMPILER" under "HI-TECH Universal tool suite" for the 16F877a.

BTW are you using 18F452 to replace the 16F877A in PR25 ?
Then that would be a different story.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: compilation problem

Postby yasotha padmanathan » Tue Feb 28, 2012 3:36 pm

hi, sorry its not the project25 but im doing the project is PR9, which is the password door lock. Im using PIC18f452. so which compiler i shud use? plz guide me..
yasotha padmanathan
Novice
 
Posts: 17
Joined: Sun Oct 16, 2011 10:21 pm

Re: compilation problem

Postby hyng » Tue Feb 28, 2012 5:26 pm

PR9?? The sample code for PR9 is for PIC16F877A not PIC18F. It is mentioned in the description. You cannot direct use the sample code if you are using other type of PIC. Have you modified the code according to PIC18F??
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: compilation problem

Postby yasotha padmanathan » Tue Feb 28, 2012 8:57 pm

i didnt modify the code. but i did sum trial 1st. Im in a cofused state because i learned tht dat code used for pic16f can be used for pic18f as well..juz need to modify sumthing rite.
yasotha padmanathan
Novice
 
Posts: 17
Joined: Sun Oct 16, 2011 10:21 pm

Re: compilation problem

Postby hyng » Wed Feb 29, 2012 10:23 am

Yupe. You need to modify the code. Most are the SFR names and address. You may refer to the datasheet.
BTW, i suggest you to go through some examples of PIC18F source code so that you know how to start.
One of the example that you can refer is the sample code of SD02B by using 18F4520 at the product page below:
http://www.cytron.com.my/viewProduct.php?pcode=SD02B&name=Enhanced%202A%20Stepper%20Motor%20Driver
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 8 guests

cron