View previous topic :: View next topic |
Author |
Message |
KevinMonk
Joined: 08 Aug 2005 Posts: 5
|
Total Newbie. Help!! Missing 18F452.h file |
Posted: Mon Aug 08, 2005 7:47 am |
|
|
1st day doing any PIC programming. I'm just attempting to get anything/something to compile then downlaod it on to a PIC. I'm using a PIC18F452 device on a PICDEM2 dev board. At the moment the compiler is coming up with an error:
#include file can note be opened:
Not in file c:\program files\PICC\devices\18F452.h
I have run the CCSC +Q program and it confirms that the 18F452 device is installed on the compiler. Why is there no associated .h file?
If anybody could recommend some good starter material for newbies it would be appreciated. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Aug 08, 2005 8:25 am |
|
|
Try compiling this. Work through some of the samples. Also I put a PICDEM2 PLUS LCD driver in the code library. Get that and try to print something to the LCD. If this doesn't compile, I would say that the software wasn't installed correctly. adding a path env variable to "C:\Program Files\PICC"
Code: | #include <18f452.h>
#case
#use delay(clock=16000000)
#fuses hs,nowdt,noprotect,nolvp
#use rs232(baud=19200,xmit=PIN_B4,invert,stream=DEBUG)
#zero_ram
#define VER_MAJOR 2
#define VER_MINOR 00
//======================= MAIN ============================//
void main(void)
{
fprintf(DEBUG,"\n\r");
fprintf(DEBUG,"STARTING\n\r");
fprintf(DEBUG,"FIRMWARE VERSION %u.%02u\n\r",VER_MAJOR,VER_MINOR);
//****************//
fprintf(DEBUG,"Start..\n\r");
fprintf(DEBUG,"done!\n\r");
while(1)
{
}
}
|
|
|
|
KevinMonk
Joined: 08 Aug 2005 Posts: 5
|
|
Posted: Mon Aug 08, 2005 8:54 am |
|
|
Thanks.
but.. I'm still left wondering why I dont have an 18F452.h file in any of my include directories. SUrely they should be there right? |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Mon Aug 08, 2005 9:22 am |
|
|
Are you using the demo version of the compiler or a full licensed version?
From the CCS web page:
Quote: | Only the Microchip 14 bit PIC16F877, PIC16C544 and 16 bit PIC18F458 target devices may be specified. Click here for a current and complete list of devices supported by CCS. All PIC12, 14, 16 and PIC18 devices are supported in the full product. |
_________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Aug 08, 2005 9:28 am |
|
|
rwyoung is right. If you don't have the file
"c:\program files\PICC\devices\18F452.h"
Then the software isn't installed right
OR
you don't have the full commercial version.
The free version only works on limited PICs.
ie I have 280 files in the devices folder. |
|
|
KevinMonk
Joined: 08 Aug 2005 Posts: 5
|
|
Posted: Mon Aug 08, 2005 9:58 am |
|
|
Ok. problem solved. Seems I was using the PCW compiler rather than the PCWH compiler that is needed for compiling code for PIC18F devices.
Thanks for your help anyway.
The CCSC +Q thing still tells you that the program has 18F devices included though.
All seems to be compiling now. Now i've just got to figure out how to get the program on the board and I'll hopefully be a little bit higher up this VERY steep learning curve. I'm just hoping that it will be one of these things that just starts to click and gets easier the more you get in to it. |
|
|
|