CCS C (older version 3.245) & PIC16F887

Started by Jeff Cooper February 20, 2009
My CCS C compiler (PCM) is old enough to not have a 16f887.h include
file but I was wanting to try that chip. I emailed CCS tech support
asking if they had a 16f887.h but they said "You will need a version
4 compiler to use the 887 chip."

I find that hard to believe if, in fact, the PIC16F887 is a true
PIC16F family part with classic PIC16F peripherals. So I have that
question in to them.

My question here is, can I clone/tweak an existing 16fxxx.h file and
expect at least basic, if not full operation with my CCS PCM C
compiler v3.245?

Comparing the PIC16F887 to the PIC16F877A on the Microchip site,
shows only that the PIC16F887 has self-write, 8MHz & 32KHz internal
osc., & 6 more A/D channels. They may be other differences too fine
to note on the Microchip 8-bit product selection webpage.

I don't have a PIC16F887 yet so I thought I'd ask here. Maybe MPLAB
will let me use the HiTech PICC-Lite compiler but I like the features
in my CCS compiler if, indeed, I can use it.

Thanks,
Coop, AA1WW

> My CCS C compiler (PCM) is old enough to not have a 16f887.h include
> file but I was wanting to try that chip. I emailed CCS tech support
> asking if they had a 16f887.h but they said "You will need a version
> 4 compiler to use the 887 chip."
>
> I find that hard to believe if, in fact, the PIC16F887 is a true
> PIC16F family part with classic PIC16F peripherals. So I have that
> question in to them.
>
> My question here is, can I clone/tweak an existing 16fxxx.h file and
> expect at least basic, if not full operation with my CCS PCM C
> compiler v3.245?
>
> Comparing the PIC16F887 to the PIC16F877A on the Microchip site,
> shows only that the PIC16F887 has self-write, 8MHz & 32KHz internal
> osc., & 6 more A/D channels. They may be other differences too fine
> to note on the Microchip 8-bit product selection webpage.
>
> I don't have a PIC16F887 yet so I thought I'd ask here. Maybe MPLAB
> will let me use the HiTech PICC-Lite compiler but I like the features
> in my CCS compiler if, indeed, I can use it.

I don't think I've tried this, but as long as CCS doesn't hard code in
the supported parts you should be able to tweak a similar 16Fxxxx part
to work. Microchip keeps their hardware blocks pretty consistent across
a part line.

DLC

> Thanks,
> Coop, AA1WW
>
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
Dennis,

Thanks for your reply. Here's the response (they are prompt) that I
received from CCS tech support about why I'd have to upgrade the
compiler.

"The opcodes are the same but the SFR's are different in location and
layout. Some algorithms for SRF access are also new for the 88x and
72x parts."

I'm guessing the "SRF" above really means SFR. So I guess I'll have
to dive into the datasheets if I really want to save a $2-3USD / chip
over the PIC16F877A.

Thanks,
Coop, AA1WW

--- In p..., "Dennis Clark" wrote:
> > My CCS C compiler (PCM) is old enough to not have a 16f887.h
include
> > file but I was wanting to try that chip. I emailed CCS tech
support
> > asking if they had a 16f887.h but they said "You will need a
version
> > 4 compiler to use the 887 chip."
> >
> > I find that hard to believe if, in fact, the PIC16F887 is a true
> > PIC16F family part with classic PIC16F peripherals. So I have
that
> > question in to them.
> >
> > My question here is, can I clone/tweak an existing 16fxxx.h file
and
> > expect at least basic, if not full operation with my CCS PCM C
> > compiler v3.245?
> >
> > Comparing the PIC16F887 to the PIC16F877A on the Microchip site,
> > shows only that the PIC16F887 has self-write, 8MHz & 32KHz
internal
> > osc., & 6 more A/D channels. They may be other differences too
fine
> > to note on the Microchip 8-bit product selection webpage.
> >
> > I don't have a PIC16F887 yet so I thought I'd ask here. Maybe
MPLAB
> > will let me use the HiTech PICC-Lite compiler but I like the
features
> > in my CCS compiler if, indeed, I can use it.
>
> I don't think I've tried this, but as long as CCS doesn't hard
code in
> the supported parts you should be able to tweak a similar 16Fxxxx
part
> to work. Microchip keeps their hardware blocks pretty consistent
across
> a part line.
>
> DLC
>
> > Thanks,
> > Coop, AA1WW
> >
> >
> >
> >
> >
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
> > instructions
> Dennis,
>
> Thanks for your reply. Here's the response (they are prompt) that I
> received from CCS tech support about why I'd have to upgrade the
> compiler.
>
> "The opcodes are the same but the SFR's are different in location and
> layout. Some algorithms for SRF access are also new for the 88x and
> 72x parts."

I don't remember the answer to this... If the config files also define
the locations of the SFR's then you can change that too. By algorithms
they probably mean that the SFR may be in another bank. There are no
algorithms for accessing registers in a PIC, you just access them. It
all depends on what you think your time is worth of course. ;) If the
config files completely describe the part layout and hardware blocks
then you can no doubt hack a config together that will work. Since
there are a LOT of details in there, it might take you quite a while to
do it though. In some cases you might be practically reverse
engineering the compiler or support files to do it. That support
contract might start to look pretty cheap after a while. ;)

DLC

> I'm guessing the "SRF" above really means SFR. So I guess I'll have
> to dive into the datasheets if I really want to save a $2-3USD / chip
> over the PIC16F877A.
>
> Thanks,
> Coop, AA1WW
>
> --- In p..., "Dennis Clark" wrote:
>> > My CCS C compiler (PCM) is old enough to not have a 16f887.h
> include
>> > file but I was wanting to try that chip. I emailed CCS tech
> support
>> > asking if they had a 16f887.h but they said "You will need a
> version
>> > 4 compiler to use the 887 chip."
>> >
>> > I find that hard to believe if, in fact, the PIC16F887 is a true
>> > PIC16F family part with classic PIC16F peripherals. So I have
> that
>> > question in to them.
>> >
>> > My question here is, can I clone/tweak an existing 16fxxx.h file
> and
>> > expect at least basic, if not full operation with my CCS PCM C
>> > compiler v3.245?
>> >
>> > Comparing the PIC16F887 to the PIC16F877A on the Microchip site,
>> > shows only that the PIC16F887 has self-write, 8MHz & 32KHz
> internal
>> > osc., & 6 more A/D channels. They may be other differences too
> fine
>> > to note on the Microchip 8-bit product selection webpage.
>> >
>> > I don't have a PIC16F887 yet so I thought I'd ask here. Maybe
> MPLAB
>> > will let me use the HiTech PICC-Lite compiler but I like the
> features
>> > in my CCS compiler if, indeed, I can use it.
>>
>> I don't think I've tried this, but as long as CCS doesn't hard
> code in
>> the supported parts you should be able to tweak a similar 16Fxxxx
> part
>> to work. Microchip keeps their hardware blocks pretty consistent
> across
>> a part line.
>>
>> DLC
>>
>> > Thanks,
>> > Coop, AA1WW
>> >
>> >
>> >
>> >
>> >
>> >
>> > to unsubscribe, go to http://www.yahoogroups.com and follow the
>> > instructions