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

2 PICs (8-bit), same size and program, different ROM usage?

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



Joined: 05 Sep 2007
Posts: 46
Location: Londrina - Brazil

View user's profile Send private message

2 PICs (8-bit), same size and program, different ROM usage?
PostPosted: Thu Jan 08, 2009 5:31 am     Reply with quote

This is very strange to me.

My compiler version is: 4.057

I'm using a 16F628A in my project, but when the ROM usage hit 99% I changed to 16F870 just for testing ROM usage. The strange thing is ROM drop to 85%. (both PICs have 2kwords).

How is that possible if the only change I made in the code was internal to external oscillator?

I'v also checked the instruction set in both datasheet, and they're same!

So, same instruction set, both 8-bit, same program.. but one is 15% smaller??? How?
_________________
Give a man a fish and you'll feed him for a day. Teach a man to fish, and you'll feed him for a lifetime.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 08, 2009 12:06 pm     Reply with quote

What peripheral modules are you using ? They are on different pins
in these PICs. It's possible that on one PIC you are using a hardware
module, but in the other PIC you are using software emulation.
(i.e., CCS can do a hardware or software UART, depending on the pins
that are specified in the #use rs232() statement).

Also, the RAM layout is different. There might be a different allocation
of variables, requiring more bank select instructions.

However, 15% does seem excessive. If you want to know for sure,
you will have to do a side-by-side comparison of the .LST files.
rhaguiuda



Joined: 05 Sep 2007
Posts: 46
Location: Londrina - Brazil

View user's profile Send private message

PostPosted: Thu Jan 08, 2009 12:14 pm     Reply with quote

Thanks for replying PCM.

When I put a receive/transmit PIN that is different from PIC's TX/RX pins, the compiler automatically creates a software USART?

Anyway, I don't believe this is the problem, because in 16F628A the pins were correctly assigned to TX/RX pins. If with the 16F870 the compiler was generating a software USART, than the code would be larger, not smaller, isn't?

Well, about taking a look at both .lst files, I have no time to make a side by side comparison, so I took another PIC and move on with my project.

Thanks very much.
_________________
Give a man a fish and you'll feed him for a day. Teach a man to fish, and you'll feed him for a lifetime.
asmallri



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

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

PostPosted: Thu Jan 08, 2009 12:39 pm     Reply with quote

Quote:
Give a man a fish and you'll feed him for a day. Teach a man to fish, and you'll feed him for a lifetime.


If he does not have a fishing license then the state will feed him for free - some restrictions, such as liberty and choice of clothing, apply.
_________________
Regards, Andrew

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



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Jan 08, 2009 3:03 pm     Reply with quote

I prefer "Build a man a fire and he is warm for a day. Set a man on fire and he is warm for the rest of his life." Call it January humor....
_________________
The search for better is endless. Instead simply find very good and get the job done.
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