View previous topic :: View next topic |
Author |
Message |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
Unknown device type |
Posted: Wed Feb 06, 2008 5:29 pm |
|
|
I am using PCH Compiler V4.066
When I compile any of the examples in the Example directory I get the following error:
C:\PROGRA~1\PICC\devices\18f452.h, Line 2
Unknown device type
I am using the command line complier and I am trying to use the compiler inside of MPLAB v8.00. I have installed the plugin so CCS will work within MPLAB.
It does not seem to matter which device I try to compile for I get the same error that there is an unknown device.
I have read other posts and most people do not have the MPLAB plugin installed or there is a pre-existing installation of the CCS demo. Neither of these problems are the case here. Also, the PIC18F452 is in the supported list.
Does anyone know how I can fix this or have any idea what I can do? Thank you in advance. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 5:34 pm |
|
|
Did you use the Project Wizard in MPLAB to make the project ?
If you selected 18F452 as the PIC in the wizard, it should setup
the project correctly.
Go to the Configure menu in MPLAB, and go to Select Device
and make sure that it's set for 18F452. |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 5:40 pm |
|
|
Yes I did use the project wizard and yes I did select 18F452 from the configure menu.
The project is set up correctly.
I have even tried to compile the examples using the command line and cannot get it to compile. I get the same error for every file. |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 5:59 pm |
|
|
I just want to reiterate that this is not a problem with MPLAB. I am trying to compile from the windows command prompt. The command I am entering is:
Ccsc.exe +P "\Program Files\ PICC\Examples\EX_AD_12.C"
And the error returned is:
C:\PROGRA~1\PICC\devices\18F452.h, Line 2
Unknown device type
I am using the +P option so the ccs C compiler output will stay on the screen.
I have tried reinstalling the PCH compiler and this has not fixed my problem. I have not edited any of the example files. The actual error is comming from line 2 of the file "18f452" in the devices folder. Line 2 is:
#device PIC18F452
If any more information is required I would be happy to send it out. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 6:04 pm |
|
|
1. In what order did you install the programs ?
The "plug-in" should be installed last.
2. Are you running the demo ?
The demo doesn't support the 18F452. |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 6:06 pm |
|
|
1. I Installed PCHUPD then I installed the plugin.
2. This is not the demo version, I purchased the retail version of PCH earlier today. It is version 4.066 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 6:11 pm |
|
|
Quote: |
I just want to reiterate that this is not a problem with MPLAB. I am trying
to compile from the windows command prompt. The command I am
entering is:
Ccsc.exe +P "\Program Files\ PICC\Examples\EX_AD_12.C" |
I apologize for not reading your post in detail. I will now look at your
problem of using PCH in a command prompt. (and not in MPLAB). |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 6:17 pm |
|
|
OK, the problem is that you're not specifying the compiler (PCM, PCH, etc).
To see a list of options for the command line compiler, type the following
in a C: prompt window:
This will bring up a help window and you will see immediately the
command line parameter that you need to add, to select PCH. |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 6:18 pm |
|
|
Hey no problem.
I also tried to compile the examples for the PIC18F458 with the retail version of PCH. To do this I changed the # define statement in the example to:
Code: | #include <18F458.h> |
My error is the same just for a different device:
C:\PROGRA~1\PICC\devices\18F458.h, Line 2
Unknown device type
So this error is not just for the 18F452. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 6:42 pm |
|
|
It works for me. Edit the Ex_ad12.c file, and change the line where
it has
Code: | #include <18F452.h> |
to
Code: | #include <18F458.h> |
Open a command prompt window and change to this directory: Quote: | c:\Program Files\Picc |
Then type:
Quote: | ccsc +FH +P "c:\Program Files\Picc\Examples\Ex_ad12.c" |
|
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 6:52 pm |
|
|
Thank you for the response, but I still get the same error:
Code: | C:\PROGRA~1\PICC\devices\18F458.h, Line 2
Unknown device type |
I am developing for the 18F452, I was just trying to compile for another device that I know "should" compile(18f458).
Is there anything else I can try? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 6:59 pm |
|
|
If it keeps giving that error, then I don't think you have PCH installed. |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 7:09 pm |
|
|
Copying from my receipt:
Quote: | Products
1 x PCH Command-line Compiler for PIC18 MCU parts
- Software Updates (Maintenance): 30 days of Maintenance
- Products: PCH Software (Windows)
|
I downloaded PCH from your website through a link that was given to me in an email.
The installer is named "pchupd.exe"
When I type in the command
Quote: | ccsc +FH +P "c:\Program Files\Picc\Examples\Ex_ad12.c" |
The CCS C compiler comes up in a purple window and says at the top
Quote: | CCS C Compiler
PCH Compiler V4.066 |
I am pretty sure that PCH is installed. If you want me to paste what I am compiling (which is the unmodified example code that comes with the compiler) to the fourm, I will be more then happy to do so. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 06, 2008 7:18 pm |
|
|
Did you get a license file from CCS ? The filename will be:
It has to be placed in this directory:
Quote: | c:\Program Files\Picc |
CCS will email you the license file, shortly after you buy the compiler.
Also, what O/S are you using ? Is this being done on Vista ? |
|
![](templates/subSilver/images/spacer.gif) |
milk3422
Joined: 06 Feb 2008 Posts: 10
|
|
Posted: Wed Feb 06, 2008 7:21 pm |
|
|
I did get the email with pch.crg attached and I placed it in the directory
Quote: | C:\Program Files\PICC |
The operating system I am using is Windows XP SP2 |
|
![](templates/subSilver/images/spacer.gif) |
|