Page 1 of 1

Array memory limits

Posted: Mon Mar 30, 2015 8:36 am
by speedracer
I'm thinking about building a couple of mini-dataloggers for my race car. I'd like to log time, the analog output of a ride-height sensor, and maybe a measure of rpm using the PULSIN command (I've already made a quicky TACH using this command). With maybe 16K of RAM available to store data, I'm wondering how to allocate memory and how to estimate how quickly it will fill up.

For time, the simplest thing would be to DIM a string array. Since I know how long the string I'll be saving is, I could estimate how long an array I can fit into memory -- if I knew the particulars of the storage. Other BASIC's have a several byte overhead for strings; what is it for EZ-Basic?

The other signals I'd like to log are integers -- but there are no explicit integer array variables defined in the Programming manual. I suppose I could scale the numbers and store them as FP (10000 * TACH + RIDEHEIGHT, say) but I'd prefer to save each in a separate array. If I force the values to be integers [e.g. TACH(k) = INT(rpm)], will the values be saved as integers? How would this affect the RAM allocated when I DIM the array?

Finally, is there a PEEK or something I can use to find out how much free RAM I have?

Thanks,

Charles

Re: Array memory limits

Posted: Mon Mar 30, 2015 8:58 am
by speedracer
Had another thought about saving my data:

An old way to store stuff (like machine code) in Basic was to save the hex data in string arrays. I can't tell from the manual but are there any limits on the characters you can store as strings? I could parse up my integer data and add it as characters to the end of the TOD data and save everything as one string entry in the string array -- if the possibility that some characters would be control characters is not an issue.

This still leaves the question of how I tell how much RAM I have left.