Programm size ?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Programm size ?

Post by Albert38 »

Hello, I'm new to flowcode and to my opinion, somehow I do something wrong.

I made this first programm and run out of programm memory. What I see is that the Analog inputs I use in the macro 'Analog_input' are using 1037 program words and the calculation made in the same macro 236. In my opinion these aren't the most special functions and I don't see why they use so mutch program space.

Im I doing something wrong?

The programm doesn't make mutch yet it is only a tryout of some functions I need in my final program to heat controll my pool.

Thanks for your help...
Attachments
seconds_counter.fcf
first project
(34.27 KiB) Downloaded 236 times

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

Re: Programm size ?

Post by medelec35 »

You ran out of memory because of 7 lots of float variables, and two lots of string with 20 chars reserved. Floats variables take up If you can use bytes of int instead of float that will help, unless you require precision of float. You can reduce the string size from the default 20 if 20 are not needed.

To give you an idea, I believe 1 float = 32 bits since you have 7 lots of float then 7 * 32 = 224 bits of reserved memory.
With the string you have 40 * 8 bits = 320 bits so far without any other variable you require 544 bits of reserved RAM. See how easy it is to run out.. <talking form experience :P >
Martin

Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Re: Programm size ?

Post by Albert38 »

Thank you medelec35 for your reply. this is verry intresting, I can cut the string values to a smaller size in my example I only use 2 digits for the largest string.

But the biggest problem is that my ROM memorie is full with this programm I do not understand what is using so mutch bytes. And becourse I'm new to flowcode any tips on reducing the ROM size of the programm are verry welcome, I tried to use loops with changing varaibles as mutch as posible but that did not help.

P.S. I just noticed that making the String size smaller also less ROM is used.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Programm size ?

Post by Benj »

Hello,

Floats and floating point functions consume a huge amount of memory on a 8-bit device. You may want to consider changing your functionality to use integer maths if at all possible. This should allow your ROM usage to come right down.

Post Reply