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

Missing Device

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







Missing Device
PostPosted: Sat Dec 23, 2006 12:04 am     Reply with quote

It likely doesn't need to be said, but I'm a total beginner to this stuff. Anyway, before I could even start, I've managed to hit a dumb little roadblock that would probably take anybody else 2 seconds to solve.

I have installed the PCWH Compiler
IDE v3.42,
PCB v3.202,
PCM v3.202,
PCH v3.202

I have the 18F8722 PIC and the ICD-U40.

First off, the tutorial booklet that I'm going through is telling me to select "PCH 16 bit" from the drop-down box under the compile option. However, only "Microchip 12bit", "Microchip 14bit", and "Microchip PIC18" are the available options. How do I add the correct device?

Secondly, the problem is that when I try to compile the following excercise, I get an error that the header is missing. Does anybody know where I get this header and why it isn't already available? I looked in the devices folder and noticed that it only has up to 18F8720.

Code:
#include <18f8722.h>
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT
#use delay (clock=20000000)

#define GREEN_LED PIN_A5

void main () {
   while (TRUE) {
      output_low (GREEN_LED);
      delay_ms (1000);
      output_high (GREEN_LED);
      delay_ms (1000);
   }
}



Of course, I've tried messing around a little bit. I told it to include 18f8720.h instead. And I selected "Microchip PIC18" for the device. It compiled but upon starting the connection via the debugger, I got this error: "Could not connect: Cannot get firmware version: Unit in wrong mode or command not supported."

Any help would be GREATLY appreciated. I'd like to at least just get off the ground. Rolling Eyes
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Dec 23, 2006 5:54 am     Reply with quote

Quote:
First off, the tutorial booklet that I'm going through is telling me to select "PCH 16 bit" from the drop-down box under the compile option. However, only "Microchip 12bit", "Microchip 14bit", and "Microchip PIC18" are the available options. How do I add the correct device?
It looks like your tutorial is referencing to another (older?) version of the CCS environment. Check the table below for how the different names match.

Code:
Microchip    CCS
--------------------------
PIC10/12     PCB    12-bit
PIC16        PCW    14-bit
PIC18        PCH    16-bit


Quote:
Secondly, the problem is that when I try to compile the following excercise, I get an error that the header is missing. Does anybody know where I get this header and why it isn't already available? I looked in the devices folder and noticed that it only has up to 18F8720.
Microchip produces many new processor models evey year. Your v3.202 compiler is 2 years old so it is not surprising some type numbers are not supported.
Adding a new chip model to the compiler not only requires a new header file but also a new compiler configuration for this chip type. If you bought the PCWH package than you will find the program chipedit.exe in the PICC directory. With this program you can add new chips to the compiler:
- Copy the profile of a chip from the same family.
- Change the parameters that are different for your model.

As a side note: v3.202 was one of the first v3.2xx compilers. V3.2xx was a major update to the compiler and contained many bugs in the first half year of new releases (sounds familiar to the current v4.xxx situation). To save yourself a lot of time I recommend you not to use this version. The older versions v3.187 tot 3.191 were stable or use anything from 3.226 to 3.249.

Quote:
Of course, I've tried messing around a little bit. I told it to include 18f8720.h instead. And I selected "Microchip PIC18" for the device. It compiled but upon starting the connection via the debugger, I got this error: "Could not connect: Cannot get firmware version: Unit in wrong mode or command not supported."
I don't know where this is comming from, but most likely it is the debugger reading the device-id from the chip and receiving the unknown id for the new 18F8722 model.

Easiest solution: Get yourself a newer compiler version or use a chip supported by your compiler version.
jannable
Guest







PostPosted: Sat Dec 23, 2006 1:01 pm     Reply with quote

Unfortunately, I think I'm forced into doing it the hard way. Would you be able recommend a resource that would help me identify which parameters are different between the 18F8720 and the 18F8722? I ran chipedit and managed to create a new device based on 18F8720. However, I'm not sure which parameters to change. The next step is creating the 18F8722.h file. Any ideas of how to obtain this file?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Dec 23, 2006 6:24 pm     Reply with quote

Adding new devices to the compiler using chipedit is only a last resort option, it requires a lot of time tp check all options in the datasheet and often you will find your new chip has new features not supported by your compiler yet. Considering you are using v3.202 which was a beta release with many bugs in it I would spend the money for a compiler update (go for v3.249 as v4.xxx is still beta quality).

With CCS you can buy another year of maintenance even when your last maintenance contract expired a long time ago, I mean, unlike other companies you don't have to buy a the complete version of the program when you have a gap in the maintenance contracts. If you are only going to use PIC18 processors from now on (I can recommend this) then the PCH compiler will do, a renewal of this maintenance contract only costs $99.
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