Hi,
Before I start with my problem I'd like to ask, is the RAM Memory Free reported by Basic Micro Studio is a reliable measure of the amount of RAM a microcontroller will have on boot up? If so then i'm experiencing very strange behaviour with the values that it's reporting.
I've got a byte array allocated in my program that contains controller object i've created. Each of these is 64 bytes in size, so i've simply done this in my program.
Code:
Controllers VAR Byte(NumControllers * 64)
What i'm experiencing is that as I increase the value of num controllers, the RAM Memory Free reported by Basic Micro Studio decreases by 64 byte increments as expected, and then will suddenly jump down by 1K at a particular point. Initially I thought it was the calculation that was at fault, so I hardcoded the value in this case 1071 but it still reported the lost K. If I instead used 1070 as the array size, it would suddenly return that lost K.
It seems the position of the declatation has an effect on this, as if I put it last (after all other variables) I could only put 1000 before the K jump occured. If i put it right at the start of my program, before enabling hserial and other things, the reverse of the issue occured, where by I could increase the array by 200 and the ram free wouldn't drop. All very strange.
Is this a known issue, as I find when the jump occurs my program fails to operate correctly on my ARC-32. I can only presume this is because there isn't enough RAM free for the board to operate, but does it really need 900B for the basic interpreter, stack and hservo?
Thanks in advance.
-1
Edit: Just rearranged my code so that I enable HServo and HSerial after all my constants and array declarations. Now I can get my array up to 1592 bytes, leaving me 1584 bytes free. If I add an extra byte to that, I suddenly get -10 bytes free (a whole 1.5K vanished

), and Studio will no longer let me load the program onto the board.