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 CCS Technical Support

Changing Chips on a Program

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



Joined: 31 Jul 2012
Posts: 8

View user's profile Send private message

Changing Chips on a Program
PostPosted: Fri Mar 14, 2014 8:40 am     Reply with quote

I am pretty new to CCS. The company I work for got CCS back in in about 2007...looks like it is version 4, so its an older one.

The program I am working with was programmed for the PIC16C62B and I think the programmer was the PICKIT 1. I would like to change the chip being used to a PIC16F886 with the programmer being a PICKIT2.

I simply changed over the header file to 16F886 and everything seems to build ok, and it seems to program the chip but it doesnt work:Smile) I was hoping for the best, but it didnt happen:) So can someone help me. I can post the program, but I just want to make sure first that I am not setting something up that is very basic.

So there must be something more "extensive" that must be done. Sorry for the open ended and very vague question, but can someone lead me in the right direction to get started.

As you can tell, I am still very new with this, but I am newer on the CCS compiler. Most of my little experience has been done on Hitech.
beeson76



Joined: 31 Jul 2012
Posts: 8

View user's profile Send private message

PostPosted: Fri Mar 14, 2014 8:47 am     Reply with quote

I guess what I am also asking is that I am familiar with the fuses in Hitech but I don't see that anywhere in CCS. Do I have to program them in?
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 14, 2014 8:54 am     Reply with quote

You gotta start small...
step 1..make a '1Hz flashing LED' program and get it working.Several examples here on the forum,main() consists of a delay_ms(500); followed by a output_toggle(pin_of _your_choice); statement

You'll have to set appropriate fuses for whatever 'clock' you're using(internal, external, 20MHz, 4Mhz,etc), disable any peripherals like WDT,ADC, etc.
Be sure to use a current limiting resistor in series with the LED(typically 330r).

This program will confirm your hardware is OK, PIC is properly configured and you can cut/compile/download a program.

If using MPLAB, be sure to select 'release' NOT 'debug' for the 'build configuration'.

Once that's 'up and running' THEN proceed to your old code...

If you have problems, show us your 1Hz program...usually it's a simple thing like a missing ; that fouls up your day!

hth
jay
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Mar 16, 2014 8:58 am     Reply with quote

is the program too big to post ?

the c62 and F886 are VERY different chips you know.
SEEING your source code would enable the maximum help.....
ckielstra



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

View user's profile Send private message

PostPosted: Sun Mar 16, 2014 2:42 pm     Reply with quote

The C-series PIC are old and you don't see them hardly being used any more. What I understand from the PIC16C62B datasheet is that this device is from 1998 and is an upgrade from an even older version. So when you say the CCS program is from 2007, I suspect the original program is even a lot older.

The C-series PIC were special in that you could only program them once, unless you had the package with glass window allowing for UV light erasure. Advantage of these one-time programmable devices over the re-programmable F-series was that the C-series were little bit cheaper. This price advantage has since long been gone.

The number of fuses in the PIC16C62B was very limited to what we are used to now: one Configuration Word, used for a total of only 5 different configurable functions.

In CCS programs it normally is very easy to switch from one processor type to another one. Change the include file and perhaps modify a few fuses and often you are ready to go.
At the start of your original program you will find a line starting with '#fuses'. That's how you configure the fuses in CCS. For a list of possible fuse names see the top of the header file for your CPU. A list of descriptions for each fuse name can be found as fuses.txt in the CCS program file directory.

The PIC16F886 is very different from the PIC16C62B. Most likely you will have to disable some devices that were not present in the 16C62B, like the extra analog ports and the CCP2. I never understood why Microchip decided to make the analog ports the default setting instead of digital I/O.
Also add the NOLVP fuse, a function not present on the older PIC but enabled by default and will keep your processor in reset when a logic low is present on pin B3.

When in doubt, post your program here at the forum. With only 2k of ROM the program shouldn't be too large. Wink
Ttelmah



Joined: 11 Mar 2010
Posts: 19553

View user's profile Send private message

PostPosted: Mon Mar 17, 2014 1:26 am     Reply with quote

As I said in another thread, the 'analog' part, was to avoid the chip waking up with analog signals connected to digital inputs.
On modern chips the extra consumption when this happens is tiny (a few uA at worst), but on the earliest PIC's, the design of the input gate, meant that if you had a voltage that sat in the transition region as the chip powered up, it could oscillate, and draw high currents. And I mean 'high'....
You could still trigger this behaviour on the non analog pins, if you had a circuit that took a few moments to wake up, and happened to put this sort of voltage to the pin (I have done it....). However setting the buffers to 'analog', avoided this on the pins where it was most likely to happen.
Now this was 'early' though. When Microchip a few years ago, published on their site a 'history' of the PIC, I had to email them and point out that their dates were wrong, since I had a product designed a year before they said one of the earliest chips launched. They said that they had not realised any products actually got launched that early (the chips were still prototypes), apologised, and amended the dates.
They kept on with the behaviour as the chips were re-designed. Only changing it on much later families....

Best Wishes
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