Only One calculation And Uses RAM 124%, why?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
imtiaz9
Posts: 15
Joined: Sat Aug 10, 2013 7:16 am
Been thanked: 1 time

Only One calculation And Uses RAM 124%, why?

Post by imtiaz9 »

Hi. in flowcode V5, I do only one calculation to scale down the adc reading to 15v and it uses RAM to 124%. what is its reason and how to solve it?
ERROR code
ERROR code
adc.jpg (25.88 KiB) Viewed 3101 times
Flowcode1.fcf
V5 ADC
(6 KiB) Downloaded 355 times

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: Only One calculation And Uses RAM 124%, why?

Post by Benj »

Hello,

Your using a small device with a floating point calculation. The floating point calculation has to do many 8-bit calculations to allow the 32-bit floating point variable to be calculated correctly. All of the temporary calculation results have to be stored somewhere and this is what's eating up your RAM.

It looks like you will either have to keep the calculation integer based or pick a device with enough RAM to support the floating point calculation.

The same program can be made to compile in v7 which has a different compiler and more efficient way of handling float variables.
Program space used 291h ( 657) of 400h words ( 64.2%)
Data space used 2Fh ( 47) of 40h bytes ( 73.4%)

Post Reply