View previous topic :: View next topic |
Author |
Message |
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
"unknown device type" error V.3249 |
Posted: Fri Aug 01, 2008 6:03 pm |
|
|
Just recently moved my projects over to a newer box with V3.249 on it. Code that compiled cleanly on the older machine (version unknown now but not much older than 3.249) gives me an error "unknown device type "PIC18F458" on the newer machine. The compiler stops at the first line of the standard header file at "#device PIC18F458". All of my "include" directories point to the right locations and the device editor lists the PIC18F458 as well so I am a little mystified as to where else to look. Has anyone come across something like this before.
Cheers,
Bygolley _________________ Cheers,
Bill |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Aug 01, 2008 6:55 pm |
|
|
Which compiler suite are you using? The CCS compiler comes in several 'flavours' for the different PIC families; PCW for PIC12/16, PCWH for PIC12/16/18 and then there are several command line versions of the compiler.
In MPLAB you can get this error when the incorrect chip is selected under 'Configure/Select Device...'. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 01, 2008 6:56 pm |
|
|
1. Are you using the CCS IDE, or MPLAB ?
If it's the CCS IDE, is it PCW or PCWH ? You need the later one.
2. If you are using MPLAB, do you have the PCH compiler installed ?
Or is it only the PCM compiler ?
PCWH or PCH is required for the 18F458. |
|
|
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
|
Posted: Fri Aug 01, 2008 7:33 pm |
|
|
Thank you both for the quick response. I am using the PCWH flavour _________________ Cheers,
Bill |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 01, 2008 7:40 pm |
|
|
Make a project. Copy and paste in this test program. The program
should consist of this code only. Try to compile it. What happens ?
Code: | #include <18F458.h>
#fuses XT, NOWDT, NOPROTECT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
//====================================
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
}
|
|
|
|
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
|
Posted: Fri Aug 01, 2008 8:19 pm |
|
|
It does the same thing as before. It stops at the first line in the 18F458.h header file at "#device PIC18F458". And the same error comes up "unknown device type "PIC18F458". The device editor under "Tools" has it in its listing and I rechecked the "Include dir..." under "Options" and it has the correct path... _________________ Cheers,
Bill |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Fri Aug 01, 2008 8:32 pm |
|
|
Hi Bill,
Long time, eh?
At the top of the compiler window is a drop down box. It should have "Microchip PIC18" selected. The other options are Microchip 12 bit and Microchip 14 bit. That's the only thing I can think of that may explain what you're seeing. |
|
|
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
|
Posted: Fri Aug 01, 2008 8:43 pm |
|
|
Hi Mark,
Yup it has...how are ya?
That is one of the first things I checked and I have been through the manual checking for the error which led me to the explanation for #device. I tried the command START | RUN | CCSC +Q and it listed my device. The confounded thing also is I moved from a CF 28 Panasonic to a CF 30 with the same OS (XP) so really no big change. Even re-installed the compiler from the disk....sheesh _________________ Cheers,
Bill |
|
|
foodwatch
Joined: 18 Apr 2006 Posts: 66
|
|
Posted: Sat Aug 02, 2008 11:15 pm |
|
|
I had a similar problem awhile back with an 18F4550 where the device file had changed. In my case it was when they added the 10 bit a/d provision by allowing ADC = 10. It is a long shot, but be sure the device files are the same vintage as the compiler. |
|
|
jfarkas
Joined: 07 Dec 2006 Posts: 4 Location: Croatia
|
|
Posted: Sun Aug 03, 2008 3:44 pm |
|
|
Copy & paste 18F458 header (device) file to same folder as your project is.
Then try compile. If compiles - it's path problem - empty space or similar
Good luck! |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Aug 03, 2008 4:54 pm |
|
|
This now has me wondering...
In 3.249, If I just rename my 18F458.h file, I get messages saying the file wasn't found, NOT the "unknown device" message. To me this indicates the compiler itself is an old version that does not recognize the 18F458 chip....
Bygolley, it sounds like to me the compiler may have an installation problem where it is not licensed properly (reg files do change periodically) or the compiler file itself is a version before the chip was added. I would suspect there is more than one version installed and somehow they are mixed... The cure may be to remove the compiler and all misc remnants then re-install the compiler. If you have the reg files for 3.249, since it is still posted, I would download the version from the CCS website and try it.
Anyone else agree or am I off base..? |
|
|
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
|
Posted: Sun Aug 03, 2008 6:08 pm |
|
|
Thanx dyeatman...you might be onto something here since the compiler refuses to acknowledge any device. I have tried a number of different part numbers with PCM Programmers snippet and I get the same result. I did try your suggestion and uninstalled etc but no cigar yet. I don't recall having to do any registration when I originally installed on the other puter so I am wondering what you mean by reg files. Could you elaborate? Also, after the new installation (after what I thought was a pretty complete uninstall) the new installation somehow "knew" what my "include dir" list was. I am wondering where it got that from...is it buried deep in the dreaded registry? I'm gonna go snooping..but no editing yet.
BTW...I have tried all of the other suggestions from everyone and many thanx. And this is the compiler version I have been using all along with this chip with no worries for over a year (or so) so I don't think the compiler precedes the chip. _________________ Cheers,
Bill |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Aug 03, 2008 6:26 pm |
|
|
In that version the pathing came from one of two places, the ccs.ini file or the autoexec.bat file. I don't believe they put it in the registry at that time.
Your registration files are files ending in .crg that must reside in the same directory as the CCSc.exe and pcw.exe files.
Mine, for PCWH example are pcb.crg, pcm.crg and pch.crg dated 11/8/2005. These were the last ones they sent out prior to version 4.
Back in version 3.xxx CCS periodically disabled the license files which forced the user to go back and ask them for new ones (this apparently was to prevent illegal copies). However, they haven't done it since Ver 4 as far as I remember.
Dave |
|
|
bygolley
Joined: 04 Jul 2007 Posts: 6 Location: Prince George BC CAN
|
|
Posted: Mon Aug 04, 2008 12:39 am |
|
|
Dave,
In the words of Montgomery Burns..."Excellent". It is all working now. It wasn't exactly what you thought but you certainly led me down the right path. I retried the uninstall but elected for the custom uninstall instead of automatic. There I was able to ensure that all the files were going to be deleted plus all of the registry entries. I also found a pcw.ini file hiding in C:\ and renamed that as well. A fresh install from the disk was next and voila....success. My latest code version is sitting on the chip as we speak and is ticking away. Thank you for your help and Thank you to everyone else for persisting. _________________ Cheers,
Bill |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Mon Aug 04, 2008 5:47 pm |
|
|
Glad I could be of assistance! |
|
|
|