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.
I have MMII(170) and a programme about 1760 bytes. When I add to the programme a little bit and upload using MMEdit and run I get a "not enough memory" error. From Geoff C's website it appears that the 170 should be able to handle ~80K of programme and up to 2,500 lines of code (mine is 76).
I am not using any arrays, have about nine variables only.
I have used Tera Term to List and see the last few lines missing.
Is this likely to be correct, or am I getting something wrong.
Thanks,
greg
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9749
Posted: 11:05pm 09 Jan 2016
Copy link to clipboard
Print this post
Hello and welcome to the forums.
This is a bit odd. I assume you are using a recent version of MMEDIT, and that you have Micromite Syntax selected?
Try this:
1) Save a current version of your code in MMEDIT
2) Open Tera Term, and type XMODEM R at the command prompt and then ENTER.
3) In Tera Term, goto FILE/TRANSFER>/XMODEM>/Send...
4) Select the file you saved in MMEDIT, and click OK.
The file should nip across to the MM, and you should see a progress window.
Does the file transfer over OK that way?
Does it run?
Smoke makes things work. When the smoke gets out, it stops!
Thanks for the suggestion but xmodem gave the same error report "Error: Not enough memory". BTW I have tried a brand new MMII pre-loaded from SC as well - same result.
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1116
Posted: 11:32pm 09 Jan 2016
Copy link to clipboard
Print this post
Greg,
What does the command "memory" return?
Also, what version of MMBasic?
Doug.
Edit: By that I mean, at the command prompt on the MM2, enter memory and please post the result.Edited by panky 2016-01-11... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
....that was for the shorter version that uploads and runs OK. Let me try the one that doesn't and I'll get back to you. (the longer version is only a few lines longer...)
greg
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9749
Posted: 11:50pm 09 Jan 2016
Copy link to clipboard
Print this post
Yes, please post code if it is not confidential as matherp says.
I have a feeling you have DIM'ed something in the array or string area of things, which is gobbling up all the available RAM. The code will tell us, if you are willing to post it. Smoke makes things work. When the smoke gets out, it stops!
Here is the code (for SIMCOM 5320 3g modem - fwiw)
OPTION AUTORUN ON
watchdog 5*60*1000 'this 5 mins is for testing only. Use 24hrs for permanent.
const dev_id%=29001
DIM amb_temp!=15.5,vbatt1!=14.8,amb_light%=225,vbatt2!=12.8,b6!=13.9,D$ length 64="1",DD$ length 3="111",DDD%=111,count%=1
server$="aaa.bbb.ccc.ddd"
portREM$="wxyz"
portLOC$="pqrs"
setpin 14, dout
pause 20000
settick 60000,TRANS,1
open "Com1:115200" AS #1
pause 2000
DO
LOOP
SUB TRANS
watchdog 180*1000
print #1, "AT+CIPCLOSE=1"
print "AT+CIPCLOSE=1"
pause 1500 : flushbuf
Hello Glen?, Doug & Panky,(... it appears I'm more interested in my problem than who is posting help!)
I don't have a means of upgrading the firmware ..yet (slow boat from...).
I would be surprised if a firmware revision would affect the memory useage in that way, but then again I am a newbie!
g
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9749
Posted: 12:01am 10 Jan 2016
Copy link to clipboard
Print this post
[Quote=matherp]The problem is lines 53 and 54 which are longer than 255 characters [/Quote]
Agreed.
Subtle error though, as I note that the console says there is PLENTY of memory available, so this was a bit of a curly one! Smoke makes things work. When the smoke gets out, it stops!
The only thing I did differently was increase the size of the pointer from dim integer ptr(5)=(-7,0, 7,0, 0,-85) ' define size of the pointers to dim integer ptr(5)=(-7,0, 7,0, 0,-95) ' define size of the pointers
relating to This SUB [code]sub rotatetriangle(n as integer, col as integer, angle as float, x as integer, y as integer, x0 as integer, y0 as integer, x1 as integer, y1 as integer, x2 as integer, y2 as integer) local float sine=sin(rad(angle)),cosine=cos(rad(angle)) local integer x0a,y0a,x1a,y1a,x2a,y2a x0a= x0*cosine - y0 * sine + x y0a= y0*cosine + x0 * sine + y x1a= x1*cosine - y1 * sine + x y1a= y1*cosine + x1 * sine + y x2a= x2*cosine - y2 * sine + x y2a= y2*cosine + x2 * sine + y xx0(n)=x0a yy0(n)=y0a xx1(n)=x1a yy1(n)=y1a xx2(n)=x2a yy2(n)=y2a tcol(n)=col end sub[/code]
EDIT: I fixed the problem by changing the pointer size I'm just curious why it happened when it seems I had lots of memory still availableEdited by lew247 2017-11-26