Tiny Basic on a Nanode

57 views
Skip to first unread message

Ken Boak

unread,
Dec 24, 2011, 3:00:58 AM12/24/11
to nanode...@googlegroups.com
This is something I have wanted to do for some time - run an interpreted Tiny Basic on the Nanode - so that newcomers can program it quickly and easily.

The latest Nanode really is evolving into a small computer system, with it's 32K SRAM and the micro SD card. There should be the means to run programs out of these memory devices, and use the SD card like a hard disk for file storage and retrieval - and tasks such as datalogging.

The first task was to find a program which can be used like an operating system - in order to tie all the various hardware functions together.  The opportunity to do this happened when I found a working port of Tiny Basic - written in C, which compiles into just under 7.8K on a standard Arduino. 

http://ec2-122-248-210-243.ap-southeast-1.compute.amazonaws.com/mediawiki/index.php/Arduino_Basic 

As it's written in C, and uses simple tables of tokens or keywords, it is easily extendable to write new keywords and functions which exercise the Nanode hardware.

Whilst it currently executes code from internal RAM, this could be redirected to the external 32K SRAM  - into which we can TFTP a simple basic program listing - or access the SD card - which we can use as a local repository or "juke box" of our favourite sketches.

Extending this Tiny Basic and including the common Arduino libraries to form an nanode operating system will be an interesting but achievable task.

With the Tiny Basic is a means to list the program, so that lines of code can easily be edited with a terminal program.  - or probably a whole file loaded using a file transfer program such as Hyperterminal or whatever.

A simple text editor could also be used to edit and manipulate html text, stored on SD or SRAM - so that web pages could be locally edited and then displayed on a browser.

The Tiny Basic is certainly fast enough to be usable, especially with the baudrate at 57600  - I did 10,000 iteration loops of

10  For A = 0 to 9999
20 Print "My Name is Joe"
30 Next A 

In just 30 seconds - anyone who remembers the early 1980s machines like the Spectrum will appreciate this is  several times quicker.

It should be straight forward  to get the Nanode (Arduino) I/O pins accessible from basic keywords - perhaps something like defining each pin as a keyword 
to set Digital 4 High. As there are only 20 I/O pins on a ATmega - it's not going to take much program space to code them up.  eg

10 Let D4 = 1      // Set Dig 4 High
20 Let A = AN1         // Get input from Analogue 1


Lots of simple hacking fun for the Christmas holiday - and if you are old enough to remember the Spectrum - this should be like child's play again


Happy Chrismas



Ken

Robin Laurén

unread,
Dec 24, 2011, 7:50:49 AM12/24/11
to nanode...@googlegroups.com

Scary! It's like the return of the VIC-20, or maybe rather the Picaxe!

Maybe i'm getting old here, but it just thrills me that you can put all the computing power from my youth into a matchbox and get it all for a few tenners. Well, apart from the keyboard and the television.

I hope i can start opening up the world of microcontrollers to my kids soon! My six year old son has done his first solder joint (better solder joints than marihuana joints :)

~rL

Ken Boak

unread,
Dec 24, 2011, 8:08:02 AM12/24/11
to nanode...@googlegroups.com
Robin

Exactly - maybe it's a 40's mid-life crisis, to return to simpler stuff, or its the ideal opportunity to have a very low cost platform that 7 year olds upwards can learn the foundations of programming.

Ken

Robin Laurén

unread,
Dec 24, 2011, 1:44:12 PM12/24/11
to nanode...@googlegroups.com

I guess that was why it got folks like us into computers. You turn on the computer and the television. Two seconds later you have a box ready to take your 10 print "Hello, world! "; 20 goto 10. Apart from the occasional games, that was really what you could do with it. And that is why creating stuff yourself was so much fun.

I suppose one problem with modern computers is that you can do so damn much with them. And that is why microcontrollers resonate with me. It's a pity these things, and the whole enthusiast movement weren't around in the way they are now back 1990s when i was supposed to study electronics engineering. Actually making circuits would have been so much more rewarding.

~rL

Andrew Back

unread,
Dec 26, 2011, 6:45:46 AM12/26/11
to nanode...@googlegroups.com


On Dec 24, 2011 6:44 PM, "Robin Laurén" <ro...@lauren.fi> wrote:

> I suppose one problem with modern computers is that you can do so damn much with them. And that is why microcontrollers resonate with me. It's a pity these things, and the whole enthusiast movement weren't around in the way they are now back 1990s when i was supposed to study electronics engineering. Actually making circuits would have been so much more rewarding.

The great thing is that the resurgence of interest in these simpler/smaller systems is not driven by simply nostalgia, but by the potential for application in uses such as IoT and physical computing.

So, whilst there is fun to be had by those of us who remember the simpler days of computing, there is also a big opportunity to create something that is highly relevant today, and that is accessible to kids and those just starting out etc.

Retro has certain appeal, clearly, but relevance today, I would suggest, has much more mileage in it.

Cheers,

Andrew

Robin Laurén

unread,
Dec 26, 2011, 11:41:48 AM12/26/11
to nanode...@googlegroups.com

I remember when i wrote my MSc thesis, only five or six years back, that i was rolling my eyes in sci fi wonder about Weiser's vision that soon computers will be so cheap and available that we can sprinkle them around our environment with little thought about things like cost.

Seems the future is at out doorstep. Today, you can already roll your own Arduino clone for a tenner, or less. Let's see what fun and wonderful things we can do with it!

~rL

Reply all
Reply to author
Forward
0 new messages