How many LONG(s) in a TASK statement?
denno
Posts: 223
in Propeller 1
This is the error I get, and the program/code still loads successfully...
Thanks..DennO
LCD_1.spin - Error at (698,8) PC exceeds cog memory by 6 longs FIT 49 2I have in that TASK in PROBBASIC, 14 LONG variables, and alot of DATA STATEMENT(s) in that TASK to run my serial LCD display.
Thanks..DennO
Comments
Variables and code must fit in 496 longs.
You say you only have 14 long vars, so it must be code size.
Try to optimize your code for that task or...
You can make any TASK use LMM by just adding "LMM"
TASK LCD_1
change to
TASK LCD_1 LMM
Of course LMM code only runs about 1/4 as fast...
Bean
Interesting to note, Bean, the above code has a GOSUB in it. Actually, in that TASK, I have 3 GOSUBS to the getADCdata. Just changing the channel for a different measurement reading on another device. This code runs. But if I put a DIFFERENT GOSUB inside that same TASK, with a different name, I get the error message that SUBS or FUNCTIONS cannot be nested. I have really tried several different approaches, and still get the same error even using your advice in previous posts/threads.
Presently, I have all eight COG(s) running with various TASK(s), (1)room temperature,(2) sonic distance (short distance using Parallax's transducer, (3)using another more powerful sonic transducer (out to 20 feet),(4)LED blink, (5), another LED blink,(6)variable voltage measurement(0 to 5 volts), (7)and yet another voltage measurement (12 volt supply), and the last COG is dedicated to running the LCD display, which is a SERIAL display (4X20). I am sending all the above data through the HUB to be displayed, along with the location and DATA info to be displayed...being able to send a line of DATA to the display with one SEROUT command is really helpful. And that is the COG that the error message says I do not have enough room in memory. So, I will try the LLM mode on that one...speed is not to important..
ADDENDUM:...Bean, I added LMM to the one TASK that was "overloaded", and that cleared up the error message. Thanks again
DennO