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

ROM used: How to interpret this value

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



Joined: 11 Nov 2013
Posts: 13

View user's profile Send private message

ROM used: How to interpret this value
PostPosted: Fri Jul 01, 2016 2:22 am     Reply with quote

I am programming a DSPIC33FJ32MC304 and am trying to understand how much space my program uses in ROM. In my listing I find the following numbers:

ROM used: 4978 bytes (22%)
Largest free fragment is 12282

The listing starts at address 0x0000 and ends at 0x0B8E.

I have two questions about those numbers:

- Why does it say 22% of ROM used when 4978 bytes of 32768 bytes is only 15%?
- Why does it say 4978 bytes used when the program ends at 0x0B8E (=2968)?
Ttelmah



Joined: 11 Mar 2010
Posts: 19544

View user's profile Send private message

PostPosted: Fri Jul 01, 2016 3:15 am     Reply with quote

The chip doesn't actually have 32K of usable program memory....

You have to look at the diagrams in section 4 of the data sheet. Though there is 32K or ROM in the program space, a large slice of this is for 'fixed' functions and can't be used by general code. So (for instance) the area up to 0x1FE in the ROM, is reserved for the interrupt vector table etc.. You get '11264 instructions' in the user program space (22528 bytes). 4978/22528 = 22.09%.

Then there is a huge amount of code not visible in your 'program'. Unless you 'rem' out the #nolist option (in the device file), all the code generated for the core library functions, won't be visible in the lst file (basically CCS default to showing the code generated by _your_ program, not their stuff). So there is a lot beyond 0xB8E.....
arnadan



Joined: 11 Nov 2013
Posts: 13

View user's profile Send private message

PostPosted: Fri Jul 01, 2016 7:20 am     Reply with quote

Thanks Ttelmah for the detailed explanations. All clear to me now.
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