![]() |
Forum Index : Microcontroller and PC projects : Memory problems MK V5.1 vs V5.2
Author | Message | ||||
rentner111 Newbie ![]() Joined: 18/03/2014 Location: AustriaPosts: 19 |
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 StatesPosts: 327 |
Yes, it's true, version 5.2 has less memory available ![]() 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: AustraliaPosts: 3282 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |