BleuLlama / TinyBasicPlus

A C implementation of Tiny Basic, with a focus on support for Arduino
403 stars 117 forks source link

V0.13 not running on Arduino Mega 2560 anymore #2

Closed tmsidrg closed 6 years ago

tmsidrg commented 11 years ago

Last tested V.0.02a - it was running on Arduino Uno and on Arduino Mega 2560. Now V 0.13 is running fine on Arduino Uno (much more RAM and great EEPROM storage) but is not running on Mega 2560 anymore. Pin13LED is blinking all the time (blink-blink-pause blink-blink-pause ...) but nothing on the serial console. Used pure Arduino Mega 2560 (no shields) and sketch was unchanged as downloaded.

BleuLlama commented 11 years ago

no errors or warnings at all at build time?

what were the configuration #defines you are using?

It might be running the "code" in the eeprom, whihc is garbage the first time you run it, so perhaps try using the EEProm explorer sketch to format it. or, disable autorun, and format it using EFORMAT in tbp.

-s

On Thu, Mar 14, 2013 at 1:57 PM, tmsidrg notifications@github.com wrote:

Last tested V.0.02a - it was running on Arduino Uno and on Arduino Mega 2560. Now V 0.13 is running fine on Arduino Uno (much more RAM and great EEPROM storage) but is not running on Mega 2560 anymore. Pin13LED is blinking all the time (blink-blink-pause blink-blink-pause ...) but nothing on the serial console. Used pure Arduino Mega 2560 (no shields) and sketch was unchanged as downloaded.

— Reply to this email directly or view it on GitHubhttps://github.com/BleuLlama/TinyBasicPlus/issues/2 .

Scott Lawrence yorgle@gmail.com

tmsidrg commented 11 years ago

--- I formatted the EEPROM with EEExplorer - running without problems --- I loaded the unchanged TinyBasicPlus-Sketch from the zip-file and changed only the lines with ENABLE_EAUTORUN. ( here are the lines with stripped comments )

//#define ENABLE_FILEIO 1

undef ENABLE_FILEIO

//#define ENABLE_AUTORUN 1

undef ENABLE_AUTORUN

define kAutorunFilename "autorun.bas"

//#define ENABLE_EAUTORUN 1

undef ENABLE_EAUTORUN

//#define ENABLE_TONES 1

undef ENABLE_TONES

define kPiezoPin 5

define ENABLE_EEPROM 1

//#undef ENABLE_EEPROM

define kConsoleBaud 9600

--- builds without errors or warning --- uploaded - opened serial console - nothing - it's strange because setup() has a Serial.println near start and this is not printed (in another test I also commented out the "while" for Leonardo - no change) --- If I write something (no matter what, only Enter is also enough) and send it as an input to the Mega the blinking PIN13LED changes - for about 10 seconds the light stays on. After 10 seconds the LED starts again with blink-blink-pause.

BleuLlama commented 11 years ago

Okay. One other thing to change. I was pushing it to the edge on my '328 with respect to RAM size, so I might have gotten some of those sizes wrong for other devices. Look for the kRamSize definition on line 184. It should look something like:

define kRamSize (RAMEND - 1160 - kRamFileIO - kRamTones)

Try changing the "1160" number to like 1500. The Uno and Mega might have other ram being used, and I'm computing the buffer size incorrectly for them.

If that doesn't work, try like 2000, and tweak till it runs?

I'm sorry that i don't have a more concrete solution for you yet.

-s

On Thu, Mar 14, 2013 at 3:30 PM, tmsidrg notifications@github.com wrote:

--- I formatted the EEPROM with EEExplorer - running without problems --- I loaded the unchanged TinyBasicPlus-Sketch from the zip-file and changed only the lines with ENABLE_EAUTORUN. ( here are the lines with stripped comments )

//#define ENABLE_FILEIO 1

undef ENABLE_FILEIO

//#define ENABLE_AUTORUN 1

undef ENABLE_AUTORUN

define kAutorunFilename "autorun.bas"

//#define ENABLE_EAUTORUN 1

undef ENABLE_EAUTORUN

//#define ENABLE_TONES 1

undef ENABLE_TONES

define kPiezoPin 5

define ENABLE_EEPROM 1

//#undef ENABLE_EEPROM

define kConsoleBaud 9600

--- builds without errors or warning --- uploaded - opened serial console - nothing - it's strange because setup() has a Serial.println near start and this is not printed (in another test I also commented out the "while" for Leonardo - no change) --- If I write something (no matter what, only Enter is also enough) and send it as an input to the Mega the blinking PIN13LED changes - for about 10 seconds the light stays on. After 10 seconds the LED starts again with blink-blink-pause.

— Reply to this email directly or view it on GitHubhttps://github.com/BleuLlama/TinyBasicPlus/issues/2#issuecomment-14923971 .

Scott Lawrence yorgle@gmail.com

tmsidrg commented 11 years ago

* 1872 * This is the minimum, with 1871 it doesn't run.

HELLO TinyBasic Plus v0.13 6727 bytes free. 4096 EEProm bytes total. OK

But I think that a greater value (2000?) has to be used to be shure that there will be no conflict with memory used by the core runtime and libraries. I only tested the value with startup, not with Basic programms.

With a subtraction of 2000 there are "6599 bytes free", that should be enough.

Thank you very much for your help. This was a fast way to a solution. Next I will go for a SD card.

Greetings from Germany. It's soon midnight in CET. I will go happy to bed.

Stefan

BleuLlama commented 11 years ago

EXCELLENT! I'm very happy that this cleared it up for you!

I've noted your results. Thank you!

Have a great one, and have fun!

-s

On Thu, Mar 14, 2013 at 6:43 PM, tmsidrg notifications@github.com wrote:

* 1872 * This is the minimum, with 1871 it doesn't run.

HELLO TinyBasic Plus v0.13 6727 bytes free. 4096 EEProm bytes total. OK

But I think that a greater value (2000?) has to be used to be shure that there will be no conflict with memory used by the core runtime and libraries. I only tested the value with startup, not with Basic programms.

With a subtraction of 2000 there are "6599 bytes free", that should be enough.

Thank you very much for your help. This was a fast way to a solution. Next I will go for a SD card.

Greetings from Germany. It's soon midnight in CET. I will go happy to bed.

Stefan

— Reply to this email directly or view it on GitHubhttps://github.com/BleuLlama/TinyBasicPlus/issues/2#issuecomment-14934002 .

Scott Lawrence yorgle@gmail.com

corum commented 11 years ago

I applied only the kRamSize change, leaving the ENABLE_EAUTORUN part untouched. It works GREAT! Thanks a lot for your efforts, and greetings from Italy. :+1:

BleuLlama commented 6 years ago

(Noted in the latest soon-to-be-checked-in source). closing

TylerOfftimeBrown commented 5 years ago

2781 for Chinese mega pro TinyBasic Plus v0.15 5818 bytes free. 4096 EEProm bytes total.