552
edits
(Created page with "==Tiny Basic running on Nanode== 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...") |
|||
| Line 1: | Line 1: | ||
==Tiny Basic running on Nanode== | ==Tiny Basic running on Nanode== | ||
We are all familiar with the process of editing code for the Arduino or Nanode, recompiling the code and then uploading the new hex code image up to the target board. Whilst this might be the way most applications for embedded microntrollers are developed these days - there is another way - and for some people it might just be what they need to get started. | |||
Tiny Basic is an interpreted language which runs on most microcontrollers. It needs few resources apart from a serial terminal interface and is an ideal alternative language for the Arduino or Nanode. | |||
The simplest of programs can be entered from a serial terminal window - and can be executed immediately using the RUN command - for example: | |||
10 PRINT "London Hackspace is fab!" | |||
20 GOTO 10 | |||
Most programmers aged 30 or over were introduced to programming with a similar first program - it is the "Hello World" of BASIC programming. 30 years ago - almost every home computer you could buy had some sort of Basic interpreter running in the background. | |||
[http://en.wikipedia.org/wiki/Tiny_BASIC Tiny Basic] hails from 1976, when members of the Homebrew Computer Club of Menlo Park - in Northern California's Silicon Valley were looking around for a simple and compact interpreted language that would run on their homemade Altair 8800 machines - and did not want to pay the young entrepreneur William Gates $150 for his version of 8080 Basic. So a challenge went out to the members to write their own - and several did, the most notable was Tom Pittman. | |||
http://www.ittybittycomputers.com/IttyBitty/TinyBasic/index.htm . | |||
Tom's original code has been adapted for many different platforms over the years - some written in native assembly language and some ported to C - so that it might be platform independent. | |||
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. | 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. | ||
| Line 11: | Line 28: | ||
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 and libraries together. | 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 and libraries together. | ||
I recently was made aware of an assembly language version that compiled on an AVR (eg ATmega328) into under 4K - but modifying this code was going to be a little to intense for most people - so I was delighted to see that Mike Field had taken the generic C version and updated it so that it can run on an Arduino - or Nanode - without modification. Mike's working port of Tiny Basic - written in C, compiles into just under 7.8K on a standard Arduino. If you crank the baudrate up to 115200 - it is surprisingly quick at executing. | I recently was made aware of an assembly language version that compiled on an AVR (eg ATmega328) into under 4K - but modifying this code was going to be a little to intense for most people - so I was delighted to see that Mike Field had taken the generic C version and updated it so that it can run on an Arduino - or Nanode - without modification. Mike's working port of Tiny Basic - written in C, compiles into just under 7.8K on a standard Arduino. If you crank the baudrate up to 115200 - it is surprisingly quick at executing. | ||
edits