code got too big to fit in the device

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
hazic
Posts: 24
Joined: Tue Jan 05, 2010 8:59 am
Been thanked: 1 time
Contact:

code got too big to fit in the device

Post by hazic »

Hi

I use some components like LCD, I2c, switches, RS232, Step motor. is it possible that the compiled code includes also procedures of the components that I dont use in the code? because I cant fit the file in the device (Atmega16)
is there any option to shrink it in some way?

Thanks

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: code got too big to fit in the device

Post by JohnCrow »

Hi Hazic

When you compile your flowchart, it will only include the devices you have chosen.
Looking at your description, the components you have included will need a fair amount of space, you may have no option but to use a larger processor
Had to do this myself on more than one occasion.

Is it a case of only just not fitting or a lot too big?
One way you could make a size reduction (VERY SMALL) is to use shorter variable names, ensure strings are only defined to be as long as nessesary.
i.e dont leave at the default setting.
I tried this on a fairly large program of mine and managed to get about 10 bytes reduction, so not much but it could be enough to make it fit.
1 in 10 people understand binary, the other one doesn't !

hazic
Posts: 24
Joined: Tue Jan 05, 2010 8:59 am
Been thanked: 1 time
Contact:

Re: code got too big to fit in the device

Post by hazic »

its not a lot too big, it was ok but then I just added a few little changes and it didnt fit
not i'm in a position that if I add even one command it will not fit.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: code got too big to fit in the device

Post by JohnCrow »

Thats a pain. If a program is well over the size limit you tend to think ah well and just use a bigger chip, but when it only just goes over its frustrating.

You will just have to look closely see if you can take anything out.
My other suggestion is if you are using floating point math, can they be changed to byte or integer.

You could try posting your code on the forum (if its not confidential).
Someone who uses that type processers may be able to suggest other ways optimise it for you.
Sorry I only have flowcode for pics.
1 in 10 people understand binary, the other one doesn't !

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: code got too big to fit in the device

Post by medelec35 »

JohnCrow wrote:Hi Hazic

When you compile your flowchart, it will only include the devices you have chosen.
Looking at your description, the components you have included will need a fair amount of space, you may have no option but to use a larger processor
Had to do this myself on more than one occasion.

Is it a case of only just not fitting or a lot too big?
One way you could make a size reduction (VERY SMALL) is to use shorter variable names, ensure strings are only defined to be as long as nessesary.
i.e dont leave at the default setting.
I tried this on a fairly large program of mine and managed to get about 10 bytes reduction, so not much but it could be enough to make it fit.
I agree 99% with what John has said, e.g keeping string lengths to minimum etc.
The only thing I believe won't make a difference is the length of variable names used.
e.g

Code: Select all

my_variable_name_I_want_to_use_byte=20
will use same space on your target device as

Code: Select all

Var_bte=20
This is because the variable name do not get transferred to the chip.
Where variables are concerned, the amount of room used is due to the type of variable. E.g Byte, int, float and string length etc.
Only difference is if you use longer names, it will help to work out how your program works, if you re-open flowchart a few months down the line.

I agree with John, If you can post your flowchart, I can take a look at it for you, as I now have that version of Flowcode (V4 PRO).
What version do you have?

Martin

'
Martin

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: code got too big to fit in the device

Post by Spanish_dude »

You could attach your flowcode program so we can have a look at it and maybe optimize the code a bit.

Post Reply