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

Migration from one chip set to another

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








Migration from one chip set to another
PostPosted: Sun Jun 10, 2007 11:11 am     Reply with quote

I developed a two chip system using my ICD-S40 with the 16F877A and a 16F84A on a breadboard. I use a RS232 driven LCD for a monitor and a 4 pushbutton input. The system works just fine under the breadboard conditions.

I modified the 16F877A software and ported it to a 16F648A. I modified the 16F84A software and ported it to a 12C508A. I made all of the requisite changes to pin assignements and to the fuses.

I build a prototype using the target PICs. All has been wrung out and all solder mishaps have been corrected. Unfortunately, the prototype does not work properly. About 70% of the functionality is OK. I have been driven to distraction to find what is wrong.

I know that the 16F877A has 8K available. The 16F648a has 4K available. All 4K is being used! Yes, that includes the fragments. If I try to change a delay like delay_us(50) to delay_us(100) I get an error message saying I am out of memory. If I change the delay_us(50) to delay_us(40), all is OK. So I know I am really tight.

Does anyone have any ideas I can try out? Is there something in the differences between the architectures of the two devices that are not being addressed by the compiler?

I won't post the code as it is 14 pages of C code for the two chips.

I am using the PCW compiler, version 3.190 and the Mach X programmer with the latest driver.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 10, 2007 12:42 pm     Reply with quote

Here's an old post that I wrote, that explains how to go through the .LST
file and look for inefficient code. Once you notice those areas in the
program, you can re-write the C source code so it uses less ROM.
http://web.archive.org/web/20020228162153/http://www.pic-c.com/forum/old/messages/1777.html


If you're using the #separate directive, read this thread which talks
about the risks, if the compiler uses too many stack levels:
http://www.ccsinfo.com/forum/viewtopic.php?t=27717
alchazz



Joined: 03 Oct 2006
Posts: 13

View user's profile Send private message

PostPosted: Sun Jun 10, 2007 4:42 pm     Reply with quote

Thanx, I'll look into this.
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