Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:58 08 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Memory problems MK V5.1 vs V5.2

Author Message
rentner111
Newbie

Joined: 18/03/2014
Location: Austria
Posts: 19
Posted: 03:46am 26 Jul 2016
Copy link to clipboard 
Print this post

Hi Geoff !

About a problem with the memory :

I have a basic program with a length of 417 blocks .

There the PIC is used 170F256D 44 -pin .

- - - - - - - - - - - - - - - - - -
Version : 5.1
PIC empty : MEMORY query
Flash = 60K free
RAM = 53K free

Program is transferred to the PIC and is also performed .

MEMORY query
Flash = 51k 85 % Program (1763 lines )
9k 15 % free
RAM = 28K variable 52 %
1k General
24k free
- - - - - - - - - - - - - - - - - -
Version : 5.2
PIC empty : MEMORY query
Flash = 60K free
RAM = 50K free

Program is transferred to the PIC .

Message "File tansfer completed"

then " Error : Not enough memory "
- - - - - - - - - - - - - - - - - -

Does the version 5.2 really 15% more storage space ?

Thank you very much


 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 327
Posted: 06:21am 26 Jul 2016
Copy link to clipboard 
Print this post

Yes, it's true, version 5.2 has less memory available due to one of the new features Geoff added. All you can do is try to make your program more memory efficient or switch to a Micromite using a 470 chip which has more RAM.

Here is a couple of things which may help reclaim some wasted memory:

1 - Use MMEdit's crunch feature to remove comments and extra spaces when your program is downloaded into the Micromite.

2 - If you are using string arrays, dimension the arrays using the LENGTH option to limit the size of the elements. By default each string element is 255 bytes long unless you define them to be less.

3 - If you are using arrays which contain only single byte values, poke the values directly into the memory space of the array and use peek to read the values. Long integers use 8 bytes per element, so poking 8 single bytes into the same space will reclaim a lot of wasted memory! Be sure to define the array accordingly though! To store 100 bytes would require an array size of only 13 elements.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3282
Posted: 06:10pm 26 Jul 2016
Copy link to clipboard 
Print this post

Curtis is right, there is less RAM in 5.2 and that is limiting the size of the program that you can load. This is because the program is buffered to RAM first before being written to the flash - as a result the amount of RAM is limiting the size of the program that you can load.

Using MMEdit's crunch feature will reduce the size of the program so that it will fit. Another approach is to split your program into two parts, then load the first part and save it to the library using LIBRARY SAVE. You can then load the second part and your program should run. This is because loading the program in two parts avoids hitting the limit imposed by the lesser amount of flash.

Yet another option is to stick with 5.1. So long as your program runs fine on it there is no need to change.

Geoff
Geoff Graham - http://geoffg.net
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025