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

migrating from 16F886/7 to 18F ??

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



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

View user's profile Send private message AIM Address

migrating from 16F886/7 to 18F ??
PostPosted: Sun Jul 13, 2008 7:53 pm     Reply with quote

assuming one is happy with the assorted peripheral and I/O capability of the 16f88x but wants
much program and user ram
( as can be hard in a 28 and 40 pin package - )

any suggestions on 18F ?
Ttelmah
Guest







PostPosted: Mon Jul 14, 2008 2:32 am     Reply with quote

Probably the 2520 (for the 28pin device), and 4520 for the 4 pin device. Same basic peripherals, double the ROM, and about five times the RAM. Generally cheaper than the older chips. You can also gain extra I/O pins, with the MCLR pin programmable as an input, and if your application does not require really high accuracy, you can use the internal oscillator, to give two more pins here. Clocks over 50% faster. Be prepared for 18 code to be slightly larger for things like interrupt handlers, but smaller for things like multiply.

Best Wishes
asmboy



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

View user's profile Send private message AIM Address

migration thnak you
PostPosted: Mon Jul 14, 2008 6:07 pm     Reply with quote

thanks for your generous help

the microchip site SAYS migration is EZ - but in half an hour of poking around - i never could FIND that pesky interactive migration tool they talked about ...
have you ??

either way MUCH appreciated
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Jul 14, 2008 7:27 pm     Reply with quote

Be careful of the pitfall that gets a lot of folks... Many of the register addresses are different so, if things don't work correctly, be sure to double check them...

You might get lucky and all the ones you use are in the header file and no additional changes will be required.

Also, if you get a "not defined" message for a constant during the compile check that the spelling hasn't changed in the .H file.

Dave
Ttelmah
Guest







PostPosted: Tue Jul 15, 2008 2:09 pm     Reply with quote

The migration tool, is for Microchip assembler code, not CCS.
Migration with CCS, varies according to how your code is written.
If you use 'pure CCS' code (no assembler, and no direct register accesses), then all that needs to be done, is to change the header references, get the 18 compiler version (PCH, rather than PCM) update the fuses (generally the 18 chips add a few new fuses), compile, and the code will probably run (99% probability).
If you use direct register accesses, these will need to be updated.
If you use assembler, this will need to be re-written (though things like the automatic register addressing of the CCS compiler, make the changes small).
If the chip adds extra peripherals, these will need to be disabled.
I have a program that has versions running in both the 18F452, and the 16F887. The same source code is used for both, with about a dozen lines, selected by a #ifdef, changing the fuses required. Otherwise, it runs 'as is'.

Best Wishes
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jul 15, 2008 3:34 pm     Reply with quote

Ttelmah wrote:
Probably the 2520 (for the 28pin device), and 4520 for the 4 pin device. Same basic peripherals, double the ROM, and about five times the RAM. Generally cheaper than the older chips. You can also gain extra I/O pins, with the MCLR pin programmable as an input, and if your application does not require really high accuracy, you can use the internal oscillator, to give two more pins here. Clocks over 50% faster. Be prepared for 18 code to be slightly larger for things like interrupt handlers, but smaller for things like multiply.

Best Wishes


I suggest looking at the 2620/4620 instead.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Ttelmah
Guest







PostPosted: Wed Jul 16, 2008 2:55 am     Reply with quote

A bit 'roundabouts and swings'. I have had more errata problems still showing their faces on these versions of the chips. Both derivatives have had a lot of problems, but the 2520 has been working OK, for the last couple of years, while the 2620, still shows some real surprises.
I do still consider the 2520, slightly more reliable.
I does depend 'massively' on how much more memory is needed. These give 4* the ROM, versus the 2520, giving 2*.

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