Code too big

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Code too big

Post by echase »

Is there a simple way to tell what is bloating ones code? My ROM is too full and I need to identify what is causing the code bloat. As I am a beginner at this, it isn’t very obvious to me. E.g. can I look at the C or ASM file, count certain types of line, or look for certain things to see where the ROM is mainly being used?

Or is there a website listing ‘top 10 things that oversize code’ or similar?

Alternatively my RAM and EEPROM are not very full. Can code by somehow transferred over to those areas of memory? RAM presumably not as it’s lost upon reset. But EEPROM maybe?

It’s a 16F886

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Code too big

Post by Steve »

In the Flowcode for PICmicros version, a ".stat" file is generated. This details the code use on a function-by-function basis. This may help you find out which macros are causing the problems.

You could use EEPROm memory, but there is not much available. And you would need to provide a mechanism to shift it into program memory before it is executed (this PICmicro can only run code in its program memory) - and this extra code would probably negate any space saving you might achieve.

echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Re: Code too big

Post by echase »

Superficially some 18F devices such as 18F2455 look almost pin compatible to 16F886 but with more memory. Is it easy just change the processor type and recompile the code? Or would one expect to do a number of changes especially as I have some C code add ins to get around problems with the 886 .fcd file?

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Code too big

Post by Steve »

This is possible. And Flowcode does make it relatively easy to do so. But you might need to adjust your C code.

You can try this very quickly. Just change the processor, save as a different file and then compile. If it compiles ok, then there is a good chance that it will work with the new processor. You'll also need to pay attention to the configuration data.

Post Reply