Only One calculation And Uses RAM 124%, why?
Only One calculation And Uses RAM 124%, why?
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?
- 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?
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.
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%)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel